Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PlayerSpawnHat( ply, hat )
- --return if not in table
- if not Hats[hat] then return end
- --check for current hats
- if ply.hat and ply.hat:IsValid() then ply.hat:Remove() ply.hat = nil end
- --create new hat
- ply.hat = ents.Create( "hat_ent" )
- ply.hat:SetModel( Hats[hat]["Model"] )
- ply.hat:SetAngles( Hats[hat]["Angle"] )
- ply.hat:SetPos( Hats[hat]["Pos"] )
- ply.hat:Spawn()
- ply.hat:Activate()
- end
Add Comment
Please, Sign In to add comment