local deb = require(Workspace.deb) script.Parent.Touched:connect(deb(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Torso.CFrame = hit.Parent.Torso.CFrame + Vector3.new(0,100,0) end end))
This script teleports the player 100 studs above him. For some reason, this teleports the player higher than 100 studs, and sometimes kills the player instead! If I use
hit.Parent.Torso.CFrame = script.Parent.CFrame + Vector3.new(0,100,0)
It's less glitchy, but from the player's perspective it looks a little less smooth. Any ideas?
This might mean you need a debounce. This should solve it. Here is an example:
local deb = require(Workspace.deb) local debounce = false -- Sets debounce to false script.Parent.Touched:connect(deb(function(hit) if hit.Parent:FindFirstChild("Humanoid") and debounce == false then -- Checks for debounce local debounce = true -- Sets debounce to true hit.Parent.Torso.CFrame = hit.Parent.Torso.CFrame + Vector3.new(0,100,0) wait(3) local debounce = false --Sets debounce to false end end))
If this doesn't work, Im not sure what the issue is. Hope this helps..