Advertisement
Upscalefanatic3

Anti-AFK Scripts (READ CAREFULLY)

Oct 18th, 2017
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. READ CAREFULLY!
  2. --Anti Afk
  3. Hint: Say afk.on to turn on, say afk.off to turn off
  4.  
  5. localplr = game.Players.LocalPlayer
  6.  
  7. localplr.Chatted:connect(function(msg)
  8. msg = msg:lower()
  9. if (msg == "afk.on") and (localplr.Character.Parent == workspace) then
  10. AnimBackup = localplr.Character.Animate:Clone()
  11. localplr.Character.Parent = game.Lighting
  12. elseif (msg == "afk.off") and (localplr.Character.Parent == game.Lighting) then
  13. localplr.Character.Parent = workspace
  14. localplr.Character:MakeJoints()
  15. AnimBackup.Parent = localplr.Character
  16. end
  17. end)
  18.  
  19.  
  20.  
  21. --Type your key on "Key Goes Here".
  22.  
  23.  
  24. localplr = game.Players.LocalPlayer
  25. keyToggle = "key goes here" -- make sure the key is in all caps
  26.  
  27. function onKeyPress(actionName, userInputState, inputObject)
  28. if (userInputState == Enum.UserInputState.Begin) and (localplr.Character.Parent == workspace) then
  29. animBackup = localplr.Character.Animate:Clone()
  30. localplr.Character.Parent = game.Lighting
  31. elseif (userInputState == Enum.UserInputState.Begin) and (localplr.Character.Parent == game.Lighting) then
  32. localplr.Character.Parent = workspace
  33. localplr.Character:MakeJoints()
  34. animBackup.Parent = localplr.Character
  35. end
  36. end
  37.  
  38. game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode[KeyToggle])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement