Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RemoveBF(model)
- for _,v in pairs(model:GetChildren()) do
- if v:IsA("BodyForce") then
- v:Destroy()
- else
- RemoveBF(v)
- end
- end
- end
- local noaccess = {}
- local debounceTime = 1
- script.Parent.Touched:connect(function(hit)
- if not hit.Parent then return end
- local player = game.Players:GetPlayerFromCharacter(hit.Parent)
- local torso = hit.Parent:FindFirstChild("Torso")
- local human = hit.Parent:FindFirstChild("Humanoid")
- if player and human and human.Health > 0 then
- if not noaccess[player.Name] or tick()-noaccess[player.Name] >= debounceTime then
- noaccess[player.Name] = tick()
- --RemoveBF(hit.Parent)
- local cf = torso.CFrame
- local health = human.Health
- local maxhealth = human.MaxHealth
- local speed = human.WalkSpeed
- player:LoadCharacter()
- player.Character:WaitForChild("Torso").CFrame = cf
- local human = player.Character.Humanoid
- human.MaxHealth = maxhealth
- human.Health = health
- human.WalkSpeed = speed
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement