I have a script, I say add 1 or add 2 or subtract 2 so on, but I have to copy & paste it every time to add a new number so I tried to make it more efficient but ended up here, with a broken script. :/

The concept is for it to add whatever the player says in chat to a surfacegui

z = game.Workspace.Part.SurfaceGui.TextBox
local function playerAdded(Player)
 Player.Chatted:connect(function(Message)
	
end)
if Message(1-100) then
z.Text = z.Text + Message
		
		
		
end

game.Players.PlayerAdded:connect(playerAdded)

2 comments

0

Use a code block! I think your problem might be you're trying to add a string with a number. To make a string into a number, use the tonumber function. EX, 1 + tonumber(TestBox.Text)

0

Edited for Code Block