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

how do I add an integer to a label ?

It's like my previous question , but this time I need to add a digit to a label like label1=1 so add 1 so it becomes two

I used this code:

local harvest = game.Workspace.farmlvl2 local crops = game.StarterGui.ScreenGui.Bcrops.Text

harvest.b1.ClickDetector.MouseClick:Connect(function(player)

crops = crops + 1

end)

can you tell me what i am doing wrong ?

1 answer

✓ Accepted answer

You didn't change the question?

Here's the working code I sent:

harvest.b1.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui.ScreenGui.Bcrops.Text = player.PlayerGui.ScreenGui.Bcrops.Text + 1
end)

Also, check out here for a guide on converting strings to numbers, if that is needed.

1 comment

0

oh silly me , looks like I need to analyze your code because all I did last time is just copy and paste it lol

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