Author Topic: Hatmod by Boodals & JakeBlade v4.1 (Update page 7)  (Read 47140 times)


So it's finally here, after 3 weeks of development we decided to release this "new" hatmod.


Random hat tick
Every 10 minutes, every player has a 5% chance to get a random hat.
Super admins can change the time and chance, or disable totally (See prefs).

Duplicate hats
You can get more than one of a hat type.
You can give away duplicate hats using the /giveHat [Player] [Hat] command.
Super admins can change whether players can get duplicate hats.
Super admins can toggle the /giveHat command.

Hat Items
Hats can be spawned as an item for display purpose.
They cannot be picked up. Adding one to your inventory does nothing.
The host can disable this to save datablocks (See prefs).

Hats save
Hats will save on the server automatically.
The host can change the file name of the save location using RTB, or through console. (See prefs)
Any player can clear their own hats using /clearHats.
The /clearHats command can be disabled for non-SA (see prefs).
Super admins can use /clearHats [Player] to clear [Player]'s hats.
Attempting to clear hats will ask you to confirm what your doing.

Client > GrantHat > [Hat name] [Limit] [Amount]
Grants client the hat. If limit is set (checkbox), only grant the hat if the player doesn't have the hat already.
Only super admins can place this event.

Player > setHat > [Hat name]
Sets the worn hat of the player.
Can take off hats by using None or Off.
Only admins can place this event.

Bot > setHat > [Hat name]
Same as Player > setHat
Anyone can place this event.

VCE variables
If you have VCE enabled, then variables will be created.

<var:player:wornHat> The hat that the player is currently wearing.
<var:client:totalHats> The total amount of hats the client has. Not effected by prefs.
<var:client:uniqueHats> Same as above, but doesn't include duplicate hats.
<var:client:hatCount_[HAT]> The amount of hats the client has. Replace [HAT] with a hat name. Instead of spaces, put underscores ( _ ).
<var:client:hasHat_[HAT]> 1 if the client has the hat, otherwise 0.
<var:brick:ownerTotalHats> Same as <var:client:totalHats>, but for the brick's owner.
<var:brick:ownerUniqueHats> Same as <var:client:uniqueHats>, but for the brick's owner.
<var:brick:ownerHatCount_[HAT]> Same as <var:client:hatCount_[HAT]> but for the brick's owner.
<var:brick:ownerHasHat_[HAT]> Same as <var:client:hasHat_[HAT]> but for the brick's owner.
<var:global:hatCount> The amount of registered hats on the server.

Simplewell compatible
Simplewell hats that are in your add-ons folder will be loaded.
It isn't recommended that you use these. I cannot promise that they will work.
Do NOT turn these on in the add-ons list.

Randomized Hats
If you use random or rand instead of a hat in some commands and events, it will automatically choose a random hat.

Preferences (prefs)
Configure HatMod to behave how you want, using RTB or slash commands.
Change the random hat time with /hatTime [Time] (SA only).
Change the chance to get a random hat with /hatChance [Chance] (SA only).
Disable random hats by setting the chance or time to 0.
Toggle whether players can get duplicate hats with /DuplicateHats (SA only).
Toggle the /clearHats command for non-SAs with /hatClearing (SA only).
Toggle the /giveHat command with /hatSharing (SA only).
Let all players have access to all hats with /hatAccess (SA only). If you turn this off, the players will not have gained all the hats.
Toggle whether hats are spawnable as items with /hatItems (Host only). Having this enabled doubles the datablock count, and takes up a lot of space in the item list. You will need to restart the server for this to take effect.
Force everyone to have a random hat they have access to with /forceRandomHats (SA only).

Serverless Update Notifier
A unique update notifier system that does not require me to host a website.
Basically, each client tells the server what version they have, and the server tells the outdated clients to update.
There are safety catches to prevent people faking updates.

Q: I installed the hat pack X, but it isn't shown in the add-on list!
A: Hat packs do not show up in the add-on list. This is perfectly normal, and the hats will be in game.

Q: I cant wear any hats!
A: Say /listHats. If you don't see any hats, then you have not installed any hat packs. Go download one.
If you do see hats, then see the HOW TO GET HATS section.

Q: I cant pick up any hats!
A: No you cant. Hat items are for display purpose only. Again, see HOW TO GET HATS.


First, simply download a Hat pack, and place it in your add-ons folder.
The hat pack will not show up in the add-ons list. This is perfectly normal.
By default, everyone on the server (who is not afk) will have a 5% chance to get a random hat every 10 minutes.
If you want a specific hat, as a Super Admin you can say /grantHat [Player] [Hat] where [Player] is the name of the player you want to give the hat to.
Alternatively, Super Admins can say /hatAccess to let everyone have access to all hats. Its worth noting that this does not grant everyone hats. If you turn this off, you will not have gained any hats.
Finally, to see what hats you have, say /hat. Then to wear a hat, say /hat [Hat].


When you install the mod it won't have any hatpacks to use, you need separate zips to be placed in your add-ons folder for them to load.
Inside the is a file which describes how you make your own hatpacks.

The links below will let you download the mod itself and my hatpack which includes 46 hats.


Put the inside your add-ons folder and activate it in order for it to work.
Put Hatmod_Jake inside your add-ons folder as well (you don't have to activate hatpacks as they are automatically loaded by Server_HatMod)


Server_HatMod V4.1
Hatmod_Jake 46 HATS


If you want to support Boodals and myself please feel free to send donations to the following Paypal adress:
I added this because making this mod takes quite some time, we would never charge people for downloading our add-ons, though donations would be very much appreciated.

- List of donators -


Boodals -3504 - Scripting             Gumba Jonny - 19867 - Modelling             JakeBlade - 7088 - Modelling

« Last Edit: June 02, 2014, 08:57:58 PM by JakeBlade »


v4.1 - 2nd June
Bug fixes:
Fixed hat name not being shown in the message when granting hats.
This is also a test to see how well the update notifier works. All clients with HatMod should be told to update.

v4.0 - 30th May
Added update notifier system.
Changed the way hats are stored in RAM. Should allow me to optimize in the future.
New VCE global vars for most of the prefs.
Changing your avatar will no longer remove your hat.
Bug fixes:
Fixed hats not being registered if previously on a server. This should fix bugs where saying /hat [hatname] just lists the hats.

v3.1 - 23rd April
Bug fixes:
Fixed random hats not working.
Fixed forced random hats.
Modified the restrictions on hat tick time and the hat chance per tick.
Hat chance is now clamped 1 to 20 mins.
Hat tick time is now 1 to 60 min.

v3.0 - 1st April - Not an April fools
Added 'random' keywords to /giveHat, /grantHat, /hat, and all events.
Added force random hats pref. Will forcefully equip players with a random hat that they have access to.
Added prevention to /giveHat and /grantHat when certain prefs were set which made no sense.
Added a bunch of VCE vars, see post above for details. Only active if VCE is enabled.
Large behind-the-scenes changes to make other add-ons able to use Hatmod easier.
Bug fixes:
Fixed glitch where you would not equip your hat when you reconnect.
Fixed glitch where you would not equip your hat if you don't own it but the all hat access pref is enabled.
Removed console messages every random hat tick.
Numerous other minor glitches that I cant remember.

v2.2 - 26th March
Fixed glitch with eyeOffsets for real this time.
Fixed glitch when two hats with the same name are attempted to register leaving a fake hat with a blank name.

v2.1 - 26th March
Fixed glitch with eyeOffsets.

v2.0 - 26th March
Pref for toggling spawnable hats as items.
Pref for allowing all player to have access to all hats.
eyeOffset hat config.
Bug fixes:
Enabling random hat tick in RTB prefs causing instant tick.
Some default values not being set if RTB isn't found.
Problems starting/stopping the random hat tick when using RTB to set prefs.
Probably some more that I cant remember.

v1.0 - 25th March
Hat config settings: offset, minVer. (These are for hat makers)


Look into adding hat config settings to allow for colorshift, animations, and alternative names.
Create better tutorial for hat creation.
Look into Slayer compatibility. (Its not incompatible, but things like automatic hat wearing in certain teams, etc)
Create hat packs out of simplewell and HatMod+ hats.
Fix the damn update notifier.
Remove the simplewell importer once they have been repacked.
Clean and optimise code.


Bug Fixes:
None yet

New features:
None yet

« Last Edit: June 16, 2014, 05:54:29 AM by boodals 2 »

been following the production of these hats since the start. They're great! Nice work guys

I understand you can spawn them as items, but not pick them up, but could I use onactivate - player - add item [hat] so the player can have the item in their inventory?
« Last Edit: March 25, 2014, 05:55:41 PM by eldruF »

Yes you can, but they can't be used at all and they don't have an icon, they just appear as a white bow. They basically will just take up an inventory slot.

Yes you can, but they can't be used at all and they don't have an icon, they just appear as a white bow. They basically will just take up an inventory slot.
Is there a givehat event? (onactive-player-givehat-banana)
that gives hat obviously

If no, make it, it would be nice to have this so people can make hat stores, and use VCE to sell them

haha i saw the server and Boodals multi-cliented just to make a bunch of him's in bannana hats

Also, somebody should make military hats, and helmets

or motorcycles helmets

i was on the server and wanted to ask you about your triangulation problem but you were afk ;-;

i was on the server and wanted to ask you about your triangulation problem but you were afk ;-;

Join now, server is up.

I remember this it was fun! :D

damn, 2nd reincarnation. nice looking.

Is there a way how you can save hats to players so when they rejoin they already have their hat?