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

How do i put a position value from a string into my script? I'm having trouble!

Asked by 3 years ago

I'm trying to move a part to different positions that are out into the string value. Basically on click, the parts position is taken from the string value and will make the part move.

Here's the script:

local location = script.Parent.Parent.Parent.Parent.Parent.TardisScreen.Screen.SurfaceGui.LocationFrame.Location

local function click()  
    local startCFrame = CFrame.new(location.Value)
    local model = game.Workspace.DefaultExterior

    model.PrimaryPart = game.Workspace.DefaultExterior.BasePart
    wait(0.1)
    model:SetPrimaryPartCFrame(startCFrame)
end

script.Parent.Lever.Use.MouseClick:Connect(click)

Any help is appreciated :)

1 answer

Log in to vote
0
Answered by 3 years ago

I think you need to mark the position where you want the part to move.

0
I have done this through a string that a has the position inside of it. AlecStilinski 0 — 3y
Ad

Answer this question