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

Group Rewarder where it only rewards the players in the group once?

Asked by 7 years ago
Edited 7 years ago

I've been wondering how to do this, and I tried something, but it didn't work. I have a boolValue inside of the script.

game.Players.PlayerAdded:connect(function(player)
    if player:IsInGroup(2801152) then
        local swoinz = player.leaderstats.Swoinz
        swoinz.Value = swoinz.Value + 150
        if script.Value == false then
            swoinz.Value = swoinz.Value + 150
        elseif script.Value == true then
            swoinz.Value = swoinz.Value + 0

        end
    end
end)

(Swoinz is the currency of the game)

1 answer

Log in to vote
1
Answered by 7 years ago

Name the BoolValue "BoolValue" and try to write this:

game.Players.PlayerAdded:connect(function(player)
    if player:IsInGroup(2801152) then
        local swoinz = player.leaderstats.Swoinz
        swoinz.Value = swoinz.Value + 150
        if script.BoolValue.Value == false then
            swoinz.Value = swoinz.Value + 150
        elseif script.BoolValue.Value == true then
            swoinz.Value = swoinz.Value + 0

        end
    end
end)

The script.Value will not work because the script haven't got any value.

You should add the Instance where you want to take the value, such as your BoolValue.

So write this script.BoolValue.Value

0
Well put. IcyEvil 260 — 7y
0
So this'll only give 150 swoinz to the play one time? Rallient 40 — 7y
Ad

Answer this question