Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

2 comments

0

Well put.

0

So this'll only give 150 swoinz to the play one time?

This discussion is preserved as it was. New answers, comments, and votes are closed.