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

whats wrong with my script?

Asked by
istiyak 13
10 years ago

i have tried using a script that closes the script but makes you teleport to the place

function onClicked()
    script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-1052, 752, 701.4) 
end
script.Parent.MouseButton1Down:connect(onClicked)
local Frame = script.Parent.Parent 
function onClick() 
Frame.Visible = false 
end 

script.Parent.MouseButton1Click:connect(onClick) '

didnt work...

0
Use the code block formatting next time. OniiCh_n 410 — 10y
0
i dont know how to code block istiyak 13 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

I'm assuming this is a ScreenGui? If so you could use LocalPlayer and it would be a lot easier.

script.Parent.MouseButton1Down:connect(function()
    local plr = game.Players.LocalPlayer
    local frame = script.Parent.Parent
    plr.Character:MoveTo(Vector3.new(-1052, 752, 701.4)
    frame.Visible = false
end

Comment if it didn't work.

0
where do i put it? istiyak 13 — 10y
0
Inside the TextButton. systematicaddict 295 — 10y
0
diddnt work istiyak 13 — 10y
0
Did you get any errors in the output? systematicaddict 295 — 10y
Ad

Answer this question