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.
01 | game.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 |
12 | end ) |
(Swoinz is the currency of the game)
Name the BoolValue "BoolValue" and try to write this:
01 | game.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 |
12 | 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