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

My LocalScript does not run in Filtering Enabled. Can someone explain?

I have a one label shows a number (like 0,1,2,...) and a local script inside a button inside a Gui to make the number increase:

local Button = script.Parent
local label = script.Parent.Parent.TextLabel
Button.MouseButton1Click:Connect(function()
label.Text = label.Text + 1
end)

I click play, I click the button and the number increase. But when I go to server testing, the Text does not change.

This is just a simple example for my script. The reason is that I want to make the number of ammo that could buy in one time, like 1000 ammo, it cannot be done in just one click with the normal button (without the number). Number which is increased will be sent to the event.

Can someone explain? Thanks!

1 answer

You're adding a string to a number, this will not work. Try putting tonumber(label.Text) instead of having it on its own.

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