Why is this code not working? I'm still stuck and the script is now looking like this. Te problem might be somewhere at the rank ("50") It is needed to give Rank 50 in Group more Cash than other ranks. Can some one pls help with this script. (Not free taken)
Wait(7)
local groupId = 3141417 -- Group ID from the Group ranks will be taken from.
amountvip = 4 -- This variable is the amount of RIX Vips will get each time.
amount = 2 -- This variable is the amount of RIX we will give each time.
timedelay = 2 -- (600)This variable is the amount of seconds inbetween each time the RIX is rewarded
currencyname = "RIX" -- This is the name of our Currency
while true do
wait(timedelay)
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("leaderstats") and v then
game.Players.PlayerAdded:connect(function(Player)
if Player:GetRankInGroup(groupId) >= 50 then
v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amountvip --Award the amount for above 50 rank
else
v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount --Award the amount for the ranks below 50
end
end)
end
end
