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 8 years ago
Edited 8 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.

01game.Players.PlayerAdded:connect(function(player)
02    if player:IsInGroup(2801152) then
03        local swoinz = player.leaderstats.Swoinz
04        swoinz.Value = swoinz.Value + 150
05        if script.Value == false then
06            swoinz.Value = swoinz.Value + 150
07        elseif script.Value == true then
08            swoinz.Value = swoinz.Value + 0
09 
10        end
11    end
12end)

(Swoinz is the currency of the game)

1 answer

Log in to vote
1
Answered by 8 years ago

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

01game.Players.PlayerAdded:connect(function(player)
02    if player:IsInGroup(2801152) then
03        local swoinz = player.leaderstats.Swoinz
04        swoinz.Value = swoinz.Value + 150
05        if script.BoolValue.Value == false then
06            swoinz.Value = swoinz.Value + 150
07        elseif script.BoolValue.Value == true then
08            swoinz.Value = swoinz.Value + 0
09 
10        end
11    end
12end)

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 — 8y
0
So this'll only give 150 swoinz to the play one time? Rallient 40 — 8y
Ad

Answer this question