Start weapons for my donaters, but how?

Hello Community,

some people recently wanted to donate to my server and I was trying to set up a new VIP group in ulx.
I already made some donator extras like donater playermodel and votekick permissions but I saw that on some servers, that donators get in TTT start weapons like a deagle and a random primary and a random grenade. I wanted to do the same. But I have no idea how. Is that a extra addon?
I hope someone here knows.

Greetings Tezou


hook.Add("PlayerLoadout", "DonatorRandom", function()
--The Weapon Table
local primary = {"weapon_zm_shotgun", "weapon_zm_sledge", "weapon_zm_rifle", "weapon_ttt_m16"}
local secondary = {"weapon_zm_pistol", "weapon_zm_revolver", "weapon_ttt_glock"}
local grenades = {"weapon_zm_molotov", "weapon_ttt_confgrenade", "weapon_ttt_smokegrenade"}
-- End of The Weapon Table
	if ply:IsUserGroup("donator") then
-- Give the Primary and send a message
ply:Give(table.Random(primary)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(primary) .."!")
-- Give the secondary and send a message
ply:Give(table.Random(secondary)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(secondary) .."!")
-- Give the nades and send a message
ply:Give(table.Random(grenades)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(grenades) .."!")
	end
end)

Try that.

Sorry but what should I do with this actually?

Place it in a file in lua/autorun/server

And it only applies if the usergroup is “donator” right?

Aye.

Affirmative.

and when I change this


	if ply:IsUserGroup("donator") then

to this


	if ply:IsUserGroup("vip") then

It applies to the group “vip”, right?

Yes. You should probably read up on stuff like that before asking. The wiki is free to use.

Yeah but that would probably take a lot longer then asking here :stuck_out_tongue:

Well all it is in a google search. Also please mark this as solved when you have made sure EVERYTHING is in working order.

I will try it out soon, then I set it as solved.

EDIT: Okay tried it out and it doesn’t seems to work.
I placed it in lua/autorun/server and named it “donators.lua”.


hook.Add("PlayerLoadout", "DonatorRandom", function()
--The Weapon Table
local primary = {"weapon_zm_shotgun", "weapon_zm_sledge", "weapon_zm_rifle", "weapon_ttt_m16"}
local secondary = {"weapon_zm_pistol", "weapon_zm_revolver", "weapon_ttt_glock"}
local grenades = {"weapon_zm_molotov", "weapon_ttt_confgrenade", "weapon_ttt_smokegrenade"}
-- End of The Weapon Table
	if ply:IsUserGroup("vip") then
-- Give the Primary and send a message
ply:Give(table.Random(primary)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(primary) .."!")
-- Give the secondary and send a message
ply:Give(table.Random(secondary)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(secondary) .."!")
-- Give the nades and send a message
ply:Give(table.Random(grenades)
ply:PrintMessage( HUD_PRINTTALK, "[INFO] You have received a ".. table.Random(grenades) .."!")
	end
end)

Any errors?

Nope.

Are you sure you are using the **EXACTLY **same name for your usergroup?
ULX groups are case-sensitive.

Yes I am, this is the vip part of my “groups.txt”


"vip"	
{
	"can_target"	"!%admin"
	"allow"	
	{
	}
	"inherit_from"	"user"
}

EDIT: Maybe it’s a problem in the code I got from Sm63. Somewhere it says something with “revolver” and moletov" and “zm_ stuff”. But I don’t have these things on my TTT server.

Unless you’ve deleted some of the default weapons coming with TTT, that shouldn’t be the cause.

i also tryed it and it does not work. i have not changed any core TTT including weapons.

Me too, but I have more weapons added

this is probably the script the op was talking about

goes in lua/autorun