Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a teleporting pad to a different place can you tell me what is wrong?

i keep of trying with this code

local teleporting = false

script.Parent.Touched:connect(function(hit) if hit.Parent then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then if not teleporting then teleporting = true game:GetService("TeleportService"):Teleport(346211210,player) wait(5) teleporting = false end end end end)

can anyone tell me what i have wrong or what i should change?

4 comments

0

How are you testing this code?

0

on the roblox studios

1

ad on the actual game

0

and*

2 answers

instead of if hit.Parent try if hit.Parent:FindFirstChild("Humanoid") then

--If you're grouping two parts together than this is the script I've created.--
local T1 = script.Parent
local T2 = script.Parent.Parent.T2
function onTouch(Brick)
	local Player = Brick.Parent:findFirstChild("Humanoid")
	if (Player ~= nil) then
		Player.Parent.Torso.CFrame = CFrame.new(Tel2.Position+Vector3.new(0,3,0))
	end
end
Tel1.Touched:connect(onTouch)

This discussion is preserved as it was. New answers, comments, and votes are closed.