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

Help with increasing number values?

Here is the problem I need this value to get bigger when a specific player touches a part. script

Coins = 50

function onTouch(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
Coins = +4
end

1 answer

✓ Accepted answer

You need Coins = Coins + 4. You assign Coins to the value of Coins plus 4.

Also, you need an additional end (for the function) and ~= nil is unnecessary.

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