Guest User

Untitled

a guest
Jun 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. function PlayerSpawnHat( ply, hat )
  2. --return if not in table
  3. if not Hats[hat] then return end
  4.  
  5. --check for current hats
  6. if ply.hat and ply.hat:IsValid() then ply.hat:Remove() ply.hat = nil end
  7.  
  8. --create new hat
  9. ply.hat = ents.Create( "hat_ent" )
  10. ply.hat:SetModel( Hats[hat]["Model"] )
  11. ply.hat:SetAngles( Hats[hat]["Angle"] )
  12. ply.hat:SetPos( Hats[hat]["Pos"] )
  13. ply.hat:Spawn()
  14. ply.hat:Activate()
  15. end
Add Comment
Please, Sign In to add comment