Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a gyroposition go to finish when clicked?

Asked by 8 years ago

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?

0
Is finish a vector3 value? What is in your output? What is "Item.Finish" and "Item.Start"? Where is this button in workspace? Where is the script? Where is the part you are moving? You need to provide a LOT more information! lightpower26 399 — 8y
0
Finish is not a vector3 value, it's a part, and item.finish and item.start are the positions i must have them go to. The button is in the model with the script and etc. The part am trying to move it to is the finish/start position. koolboat01 5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

0
It seems to be not working, is there a specific spot am suppose to put it at? koolboat01 5 — 8y
0
No, replace your script that you posted with this. lightpower26 399 — 8y
Ad

Answer this question