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

how to fix "attempt to perform arithmetic (add) on string"?

I'm trying to create one of those "input code" thingies when i got this error that says "attempt to perform arithmetic (add) on string"

how do i fix this?

heres the code:

local frame = script.Parent.Parent
local teckst = script.Parent.Text

function onButtonActivated()
	frame.PWInput.Text = (frame.PWInput.Text + teckst)
end

script.Parent.Activated:Connect(onButtonActivated)

1 answer

✓ Accepted answer

you have to do like so:


local frame = script.Parent.Parent
local teckst = script.Parent.Text

function onButtonActivated()
    frame.PWInput.Text = (frame.PWInput.Text .. teckst) -- replace + with two dots
end

script.Parent.Activated:Connect(onButtonActivated)

2 comments

0

ok i fix the answer

0

Thank you for this answer!

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