Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

GetRankInGroup how does that work for VIP script?

I have an problem with this script. How do I make this script work as giving VIP Rank >= 49 get 4 every ten mins?

LocalScript:

cript = true

wait(7) -- Time for player can get a chance for loading!

GroupId = 3141417 -- Group Id from the group the ranks is taken from.
TimeDelay = 2 -- (Every 10 Mins) How long time between the given Amount.
VipAmount = 4 -- The Value/Amount of Money that Group Vip Ranks get.

while true do
    wait(TimeDelay)
    game.Players.PlayerAdded:connect(function(Player)
        if Player:GetRankInGroup(GroupId) >= 49 then -- Gives Group Rank users over 49 VipAmount.
            Player.leaderstats.RIX.Value = Player.leaderstats.RIX.Value + VipAmount
        end
    end)
end

1 answer

Does this fix it?

GroupId = 3141417 -- Group Id from the group the ranks is taken from.
TimeDelay = 2 -- (Every 10 Mins) How long time between the given Amount.
VipAmount = 4 -- The Value/Amount of Money that Group Vip Ranks get.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
while wait(TimeDelay) do
        if player:GetRankInGroup(GroupId) >= 49 then
            player.leaderstats.RIX.Value = player.leaderstats.RIX.Value + VipAmount
        end
end
end)

BTW: Your TimeDelay Variable is actually 2 seconds, but I'm guessing that's for testing purposes.

2 comments

0

Thx, but I found my actual problem. The script also need to be in StarterPlayer > StarterPlayerScripts

0

Okay, but the one I have above is more efficient and faster, so I'd recommend using it, enjoy!

This discussion is preserved as it was. New answers, comments, and votes are closed.