Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local Humanoid = Character:WaitForChild("Humanoid")
- local UserInputService = game:GetService("UserInputService")
- local IsNocliping = true
- local FirstClick = 0
- UserInputService.InputBegan:Connect(function(Input, gameProc)
- if gameProc then
- return
- end
- if Input.KeyCode == Enum.KeyCode.F then
- -- if FirstClick == 1 and IsNocliping == true then
- -- IsNocliping = false
- -- FirstClick = 0
- -- end
- if FirstClick >= 2 then
- FirstClick = 0
- end
- FirstClick = FirstClick + 1
- if IsNocliping then
- IsNocliping = false
- while true do
- print(FirstClick)
- print(IsNocliping)
- if IsNocliping == false and FirstClick == 1 then
- for _, v in pairs(Character:GetChildren()) do
- pcall(function()
- if v.className == "Part" then
- v.CanCollide = false
- elseif v.ClassName == "Model" then
- v.Head.CanCollide = false
- end
- end)
- end
- elseif IsNocliping == true and FirstClick == 2 then
- for _, v in pairs(Character:GetChildren()) do
- pcall(function()
- if v.className == "Part" then
- v.CanCollide = true
- elseif v.ClassName == "Model" then
- v.Head.CanCollide = true
- end
- end)
- end
- end
- game:GetService("RunService").Stepped:Wait()
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement