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)
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