Hello, So I am attempting to create a teleport script to use as an elevator in one of the games I am working on, however my script is not running. It's a localscript in a part to test as a button (regular script was doing the same thing, however giving me an error saying that "player" was a nil value while it was a parameter in onClick) There are no errors in the output, could anyone let me know if there's something I'm doing wrong?
-- elevator trial local b = script.Parent local fL = script.Parent.Parent local f1 = game.Workspace.Elevator.floor1 function onClick(player) local p = player.Parent:FindFirstChild("Humanoid") if (p ~= nil) then p.Parent.Torso.CFrame = f1.CFrame + CFrame.new(Vector3.new(0,3,0)) end end script.Parent.ClickDetector.MouseClick:Connect(onClick) print("worked! :D") -- just here see if the script was running, i'm getting nothing in the output