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?
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)