I been trying to script something that moves when a button is clicked, but it just not working... Here's my script i been working on lately:
local Item = script.Parent local P = Item.Platform local F = Item.Finish local S = Item.Start local BP = P.BodyPosition local B = Item.Button local B1 = Item.Button2 function onClicked() if B.onClicked == onClicked then Item.BP = Item.Finish if B1.onClicked == onClicked then Item.BP = Item.Start end end end
Can i get some help plz?
I see your problem. Finish is a part. You are asking it to move to an object, not a part. You need to tell the script to go to THE POSITION of the part.
This is how your code is right now:
local Item = script.Parent local P = Item.Platform local F = Item.Finish local S = Item.Start local BP = P.BodyPosition local B = Item.Button local B1 = Item.Button2 function onClicked() if B.onClicked == onClicked then Item.BP = Item.Finish if B1.onClicked == onClicked then Item.BP = Item.Start end end end
This is how IT SHOULD LOOK:
local Item = script.Parent local P = Item.Platform local F = Item.Finish local S = Item.Start local BP = P.BodyPosition local B = Item.Button local B1 = Item.Button2 function onClicked() if B.onClicked == onClicked then Item.BP = Item.Finish.Position if B1.onClicked == onClicked then Item.BP = Item.Start.Position end end end