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

Chat message to script?

Asked by 8 years ago

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)

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) User#11440 120 — 8y
0
Edited for Code Block M39a9am3R 3210 — 8y

Answer this question