Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1.  
  2. local Player = game.Players.LocalPlayer
  3. local Character = Player.Character or Player.CharacterAdded:Wait()
  4. local Humanoid = Character:WaitForChild("Humanoid")
  5.  
  6. local UserInputService = game:GetService("UserInputService")
  7.  
  8. local IsNocliping = true
  9.  
  10. local FirstClick = 0
  11.  
  12. UserInputService.InputBegan:Connect(function(Input, gameProc)
  13.  
  14. if gameProc then
  15. return
  16. end
  17.  
  18. if Input.KeyCode == Enum.KeyCode.F then
  19.  
  20. -- if FirstClick == 1 and IsNocliping == true then
  21. -- IsNocliping = false
  22. -- FirstClick = 0
  23. -- end
  24.  
  25. if FirstClick >= 2 then
  26. FirstClick = 0
  27. end
  28.  
  29. FirstClick = FirstClick + 1
  30. if IsNocliping then
  31. IsNocliping = false
  32. while true do
  33. print(FirstClick)
  34. print(IsNocliping)
  35. if IsNocliping == false and FirstClick == 1 then
  36. for _, v in pairs(Character:GetChildren()) do
  37. pcall(function()
  38. if v.className == "Part" then
  39. v.CanCollide = false
  40. elseif v.ClassName == "Model" then
  41. v.Head.CanCollide = false
  42. end
  43. end)
  44. end
  45. elseif IsNocliping == true and FirstClick == 2 then
  46. for _, v in pairs(Character:GetChildren()) do
  47. pcall(function()
  48. if v.className == "Part" then
  49. v.CanCollide = true
  50. elseif v.ClassName == "Model" then
  51. v.Head.CanCollide = true
  52. end
  53. end)
  54. end
  55. end
  56. game:GetService("RunService").Stepped:Wait()
  57. end
  58. end
  59.  
  60. end
  61.  
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement