Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. waterlevel = 1 -- Water level, in terms of height
  2.  
  3. repeat wait() until game.Players.LocalPlayer.Character ~= nil
  4. local char = game.Players.LocalPlayer.Character
  5.  
  6. function makeswim()
  7. if char:FindFirstChild("SwimForce") == nil then
  8. local bp = Instance.new("BodyPosition")
  9. bp.Name = "SwimForce"
  10. bp.maxForce = Vector3.new(0,85000,0)
  11. bp.position = Vector3.new(0,waterlevel + 3,0)
  12. bp.Parent = char.Torso
  13. end
  14. end
  15.  
  16. makeswim()
  17. while true do
  18. if char.Torso.Position.Y < waterlevel then
  19. if char.Torso:FindFirstChild("SwimForce")==nil then
  20. makeswim()
  21. end
  22. else
  23. if char.Torso:FindFirstChild("SwimForce") then
  24. local c = char.Torso:GetChildren()
  25. for i = 1, #c do
  26. if c[i].Name == "SwimForce" then
  27. c[i]:Destroy()
  28. end
  29. end
  30. end
  31. end
  32. wait(0.1)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement