Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Press E to enable / disable
- enabled = false
- function onKeyPress(actionName, userInputState, inputObject)
- if userInputState == Enum.UserInputState.Begin then
- if enabled == true then
- enabled = false
- else
- enabled = true
- end
- end
- end
- game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.E)
- game:GetService('Players').LocalPlayer.Character.Torso.Touched:connect(function(t)
- if enabled == true then
- if t.CanCollide == true then
- t.CanCollide = false
- end
- end
- end)
- game:GetService('Players').LocalPlayer.Character.Torso.TouchEnded:connect(function(t)
- if enabled == true then
- if t.CanCollide == false then
- t.CanCollide = true
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement