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

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

Asked by 9 years ago

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?

0
How are you testing this code? XAXA 1569 — 9y
0
on the roblox studios Kai33thakid 15 — 9y
1
ad on the actual game Kai33thakid 15 — 9y
0
and* Kai33thakid 15 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

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

Ad
Log in to vote
0
Answered by
exit16 20
9 years ago
--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)

Answer this question