Advertisement
HowToRoblox

NametagGiver

Feb 20th, 2021
3,688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local nametag = script:WaitForChild("AFKGui")
  2.  
  3.  
  4. game.ReplicatedStorage.IsAFK.OnServerEvent:Connect(function(plr, isAFK)
  5.    
  6.    
  7.     local char = plr.Character or plr.CharacterAdded:Wait()
  8.     local head = char:WaitForChild("Head")
  9.    
  10.    
  11.     if isAFK and not head:FindFirstChild(nametag.Name) then
  12.        
  13.         nametag:Clone().Parent = head
  14.        
  15.        
  16.     elseif not isAFK and head:FindFirstChild(nametag.Name) then
  17.        
  18.         head[nametag.Name]:Destroy()
  19.     end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement