Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a Group Rank give starter cash in game? This is my current script.

Asked by 7 years ago
Edited 7 years ago

Which only says the players rank on the Leaderboard

local GroupID = 2972223 --Group ID of DarkGames™

game.Players.PlayerAdded:connect(function(player)
    local stats = Instance.new("IntValue", player)
    stats.Name = "leaderstats"

    local RankDisplay = Instance.new("StringValue", stats)
    RankDisplay.Name = "Ranks"
    RankDisplay.Value = player:GetRoleInGroup(GroupID)
end)
0
Are you suggesting we add this feature for you or rather you have evidence of attempting this sort of script yourself? M39a9am3R 3210 — 7y
0
Anyway, you would need to compare the values returned from GetRankInGroup and add the value for cash. M39a9am3R 3210 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Here is a script that depending on your rank in the group it gives you cash.

local GroupID =  2972223 --Group ID of DarkGames™

game.Players.PlayerAdded:connect(function(player)
    local stats = Instance.new("IntValue", player)
    stats.Name = "leaderstats"

    local RankDisplay = Instance.new("StringValue", stats)
    RankDisplay.Name = "Ranks"
    RankDisplay.Value = player:GetRoleInGroup(GroupID)

    local Money = Instance.new("IntValue", stats)
    Money.Name = "Money"
    Money.Value = 0

    if RankDisplay.Value == "RANK" then
        Money.Value = Money.Value + 150
    elseif RankDisplay.Value ~= "RANK" then
        Money.Value = Money.Value
    end
end)

0
Thanks Unkn0wn_Species 20 — 7y
Ad

Answer this question