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
11 years ago

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

1function onClicked()
2    script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-1052, 752, 701.4)
3end
4script.Parent.MouseButton1Down:connect(onClicked)
5local Frame = script.Parent.Parent
6function onClick()
7Frame.Visible = false
8end

script.Parent.MouseButton1Click:connect(onClick) '

didnt work...

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

1 answer

Log in to vote
2
Answered by 11 years ago

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

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

Comment if it didn't work.

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

Answer this question