For about a year now this question has yet to be answered. I've tried asking experts, lua coders, friends, almost everybody who could have expertise.
All the answers and codes that I have received have not worked. Not a single one.
The question is:
How do I restrict Weapons, and Entities on a server based upon a ULX rank with lua code?
(I do not want to use "URS" or any other addon whatsoever)
Whenever I try a new code, either I get errors, or the code has absolutely no effect whatsoever.
Some of these are for entities and some are for weapons. Nevertheless, they all don't work.
Here are all the codes that have failed:
function ENT:SpawnFunction(ply, tr) if ply:IsUserGroup("user") then
ply:ChatPrint("You must be a donator to use this item!")
return
end
if not ply:IsUserGroup("donator") thenply:ChatPrint("You must be a donator to use this item!")
return
end
function checkAdmin(ply)
if not ply:IsUserGroup("donator") then
ply:ChatPrint("You must be a donator to use this item!")
end
end
function DenySWEPs(ply, class)
if not ply:IsUserGroup("donator") then
ply:ChatPrint("You must be a donator to use this item!")
return false
end
end
hook.Add("PlayerSpawnSWEP", "DenySWEPs", DenySWEPs)
function checkAdmin(ply)
if not ply:IsUserGroup("donator") then
ply:ChatPrint("You must be a donator to use this item!")
end
end
I am looking for somebody who would be kind enough to assist me in making a code that works.
All codes that I posted above are free game, but individually they are about as useful as a '--'.
I don't care how it is written, or how complex the code is. I need to get this working period.
As an added bonus, if you could help explain what you did and how the code works I'd be very appreciative.
I am a novice coder and I need to learn about this stuff in order to expand my knowledge.
Sorry for the rant.
Thanks in advance!