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

for some reason if someone claimed it then you cant claim it. Help please?

local block = game.Workspace.JoiningReward.JoiningRewardBlock
local player = game.Players.LocalPlayer
block.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
	if player.CodesUsed.Codes.Value == 0 then
		player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value +1
		player.leaderstats.Breaths.Value = player.leaderstats.Breaths.Value +250
		block.JoiningRewardGui.BillboardGui.Text.Text = " "
		script.Disabled = true
	else
	if player.CodesUsed.Codes.Value == 1 then
		player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value -1
		script.Disabled = true
	end 
  end
 end
end)

how do I make it where if someone claims the reward then other people can also? because if someone claims it then nobody else can?!

1 comment

0

please tell me: are you using a localscript or script?

1 answer

✓ Accepted answer

Here your problem:

local block = game.Workspace.JoiningReward.JoiningRewardBlock
local player = game.Players.LocalPlayer
block.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    if player.CodesUsed.Codes.Value == 0 then
        player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value +1
        player.leaderstats.Breaths.Value = player.leaderstats.Breaths.Value +250
        block.JoiningRewardGui.BillboardGui.Text.Text = " "
        script.Disabled = true -- Change to false or delete line.
    else
    if player.CodesUsed.Codes.Value == 1 then
        player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value -1
        script.Disabled = true -- Change to false or delete line.
    end 
  end
 end
end)

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