Advertisement
RoScripter

AFK Command

Jul 11th, 2020
4,231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(Player)
  2.     local PlayerAFK = false
  3.    
  4.     Player.Chatted:Connect(function(Message)
  5.         if Message == "!afk" then
  6.             if PlayerAFK == false then
  7.                 PlayerAFK = true
  8.                 local ForceField = Instance.new("ForceField", Player.Character)
  9.                 Player.Character.Humanoid.DisplayName = "AFK - " .. Player.Name
  10.             else
  11.                 PlayerAFK = false
  12.                 Player.Character.ForceField:Destroy()
  13.                 Player.Character.Humanoid.DisplayName = Player.Name
  14.             end
  15.         end
  16.     end)
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement