• How would I setup name rewards?
    1 replies, posted
I run a DarkRP Community anda thing i'd like to add is if someone has the work IntexGaming in their name, it gives them a certain amount of money per 15 minutes I'm a big noob in coding.
Probably not the most efficient method but it should work (not tested) local reward = 1000 local frequency = 15 * 60 --15 minutes local community = "IntexGaming" local function GiveReward() timer.Simple(frequency,function() -- wait for the required time before running the check for k,v in pairs(player.GetAll()) do if string.match( string.lower(v:Nick()), string.lower(community) ) then --make player nickname and community name lowercase to avoid case mismatching v:addMoney(reward) end end GiveReward() --loop the function, will continue to run at the interval specified indefinitely end) end hook.Add("InitPostEntity","IntexRewards",GiveReward) --initiate as the server starts up or map changes and run the function Create this as an addon GarrysModDS/garrysmod/addons/namereward/lua/autorun/server/sv_namerewards.lua if it gives you any errors (very possible, i tend to make stupid typing errors with code) let me know and i'll correct it
Sorry, you need to Log In to post a reply to this thread.