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

Attempt to perform arithmetic (add) on Number and Instance?

I had a script in which every 10 seconds it awards you money but it errors saying "attempt to perform arithmetic (add) on number and Instance"

while true do
				wait(10)
				Players:WaitForChild(script.Parent.Parent.Parent.OwnerName.Value).leaderstats.Cash.Value = Players:WaitForChild(script.Parent.Parent.Parent.OwnerName.Value).leaderstats.Cash.Value + script.Parent.Handle.Worth 
			end

I tried changing it to tostring() but no it did not work.

1 answer

I'm assuming that

script.Parent.Handle.Worth

is a String/Int Value? If so try the following

while true do
                task.wait(10)
                Players:WaitForChild(script.Parent.Parent.Parent.OwnerName.Value).leaderstats.Cash.Value += script.Parent.Handle.Worth.Value
            end

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