of     1   

LilMcManiac
#183635220Monday, February 15, 2016 2:08 AM GMT

Okay, so I have a moving ball; that first if statements works perfectly, the second doesn't error nor does it work. script.Parent.Touched:connect(function(p) if game.Workspace.Upgrades[p.Name] then local upgrade = game.Workspace.Upgrades[p.Name] if upgrade.Name == "+1 Speed" then script.Parent.BodyPosition.MaxForce = Vector3.new(script.Parent.BodyPosition.MaxForce.X + upgrade.Value, script.Parent.BodyPosition.MaxForce.Y + upgrade.Value, script.Parent.BodyPosition.MaxForce.Z + upgrade.Value) elseif not upgrade.Name == "+1 Speed" then if upgrade.Name == "Size" then script.Parent.Size = Vector3.new(script.Parent.Size.X + 1, script.Parent.SIze.Y + 1,script.Parent.Size.Z + 1) end end end end)
ray_revenge
#183635583Monday, February 15, 2016 2:14 AM GMT

Try printing "upgrade" before the if statement to see what it actually is The if statements should be like: if upgrade.Name == "blah" then --blah elseif upgrade.Name == "blah2" then --blah2 end Not sure why you had that other stuff there also to make your code neater: script.Parent.Size = script.Parent.Size + Vector3.new(1,1,1) as well as: script.Parent.BodyPosition.MaxForce = script.Parent.BodyPosition.MaxForce + (Vector3.new(1,1,1)*upgrade.Value)
LilMcManiac
#183635769Monday, February 15, 2016 2:16 AM GMT

^ Thanks rvox;
LilMcManiac
#183636127Monday, February 15, 2016 2:21 AM GMT

Fixed it, here is the final product! script.Parent.Touched:connect(function(p) if game.Workspace.Upgrades[p.Name] then local upgrade = game.Workspace.Upgrades[p.Name] if upgrade.Name == "+1 Speed" then script.Parent.BodyPosition.MaxForce = script.Parent.BodyPosition.MaxForce + (Vector3.new(1,1,1)*upgrade.Value) elseif upgrade.Name == "Size" then script.Parent.Size = script.Parent.Size + Vector3.new(1,1,1) script.Disabled = true wait(3) script.Disabled = false end end end) Thanks rvox for making it a bit neater.
ray_revenge
#183636291Monday, February 15, 2016 2:23 AM GMT

er does that script.Disabled = true wait(3) script.Disabled = false work I would assume that the script would not continue after it has been disabled
LilMcManiac
#183640397Monday, February 15, 2016 3:17 AM GMT

It works. From my understanding, it yields any function in the script from executing until it is enabled again.

    of     1