im trying to make a block teleport me, but it outputs the title of the question
this is the code:
function touched(touch) while (h == 1) do f = script.Parent:FindFirstChild("Humanoid") f.Position = Vector3.new(0,55,0) wait(0.1) end end h = 1 game.Players.PlayerAdded:connect(touched)
Your problem is game.Players.PlayerAdded:connect(touched)
If it's a brick you touch for it to teleport you, put that script inside of a brick and replace that line with:
script.Parent.Touched:connect(touched)
Then in the code, you need to make sure f is a true value. Add if not f then return end
to make sure the rest of the code will not run.
Final code:
function touched(touch) while (h == 1) do f = script.Parent:FindFirstChild("Humanoid") if not f then return end f.Position = Vector3.new(0,55,0) wait(0.1) end end h = 1 script.Parent.Touched:connect(touched)