Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. function RemoveBF(model)
  2. for _,v in pairs(model:GetChildren()) do
  3. if v:IsA("BodyForce") then
  4. v:Destroy()
  5. else
  6. RemoveBF(v)
  7. end
  8. end
  9. end
  10.  
  11. local noaccess = {}
  12. local debounceTime = 1
  13.  
  14. script.Parent.Touched:connect(function(hit)
  15. if not hit.Parent then return end
  16. local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  17. local torso = hit.Parent:FindFirstChild("Torso")
  18. local human = hit.Parent:FindFirstChild("Humanoid")
  19. if player and human and human.Health > 0 then
  20. if not noaccess[player.Name] or tick()-noaccess[player.Name] >= debounceTime then
  21. noaccess[player.Name] = tick()
  22. --RemoveBF(hit.Parent)
  23. local cf = torso.CFrame
  24. local health = human.Health
  25. local maxhealth = human.MaxHealth
  26. local speed = human.WalkSpeed
  27. player:LoadCharacter()
  28. player.Character:WaitForChild("Torso").CFrame = cf
  29. local human = player.Character.Humanoid
  30. human.MaxHealth = maxhealth
  31. human.Health = health
  32. human.WalkSpeed = speed
  33. end
  34. end
  35. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement