Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do I add an integer to a label ?

Asked by 4 years ago

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

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
4 years ago

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.

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 rupertrosse 39 — 4y
Ad

Answer this question