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

What I'm doing wroung?

Asked by 10 years ago

spawn = game.Workspace.SpawnLocation player = script.Parent.Parent.Parent.Parent

function onClicked() player.Character:MoveTo (spawn.Postion) end

script.Parent.MouseButton1Down:connect (onClicked)

I'm trying to make a teleport back to spawn but I'm confused that it wouldn't click. Is there another script that I need to use. Like two scripts or local script or just ClickDetector?

1 answer

Log in to vote
0
Answered by 10 years ago

You din't define what player is. You would have to define player.

--For local-scripts
local Player = game.Players.LocalPlayer
--For Server-scripts
local Player = script.Parent.Parent until the Parent is a Player.
0
It's not really clear to me of what your saying TestingAndBuilding 10 — 10y
0
Well, You din't define player in your script, So when it tries to use player it would error and not work, So in my script it tells you how to define player for a localscript or regular script. These versions only work for scripts inside of PlayerGui or Backpack though. I assumed your script is in one of those two since you din't use a ClickDetector? xImmortalChaos 565 — 10y
0
I'm am also have problem where the TextButton wont work TestingAndBuilding 10 — 10y
Ad

Answer this question