Search the Community
Showing results for tags 'development'.
-
Hey everybody, Since I became the RG Commander, I have noticed that if we want to change from our battle armour to our robes, we need to call staff and waste there time. To fix this, I have written a small, lightweight script that can be put in the servers serverside autorun that allows people to switch between their battle armor and robes using a simple chat command !switch. The addon has been made in such a way that other regiments can be added with minimal effort. Thanks for considering this @Martibo @Caboose and @Wolf. The code is as follows and should be placed in garrysmod\lua\autorun\server: local SwitchPairs = { {"models/player/starwars/mistersweetroll/imperialguard.mdl","models/player/ven/guard.mdl"}, // just add a pair of models here } local SwitchTable = {} for k,v in pairs(SwitchPairs) do table.insert(SwitchTable,0,v) table.insert(SwitchTable,0,table.Reverse(v)) end hook.Add("PlayerSay","SwitchModel",function (ply,txt) if string.lower(txt) == "!switch" then for k,v in pairs(SwitchTable) do if ply:GetModel() == v[1] then ply:SetModel(v[2]) return "" end end end end)
- 12 replies
-
- 4
-
-
- code
- development
-
(and 3 more)
Tagged with:
-
Simple as that, in my opinion is one of the best design features this Site has.
Our Server
Imperial Gaming is a community founded on a fun, positive and inviting community for all to share in. Our ImperialRP is filled with custom content and over three years of refining and perfecting, we're sure you'll fit right in.
Useful Links
Our Management
Find a bug or have a suggestion for the forums?
Contact Bailey via his forums profile or on Teamspeak. He'll usually get back to you within 24 hours.