This is the script I currently have:

local part = script.Parent

part.Touched:Connect(function(hit)
	local h = hit.Parent:FindFirstChild("Humanoid")
	if h then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if player then
			local leaderstats = player:WaitForChild("leaderstats")
			local money = leaderstats.Money
			local selling = leaderstats.Games
			local cost = math.random(1000,10000)
			if selling.Value >= 0 then
           money.Value = money.Value + selling.Value*1 -- talking directly about this line
				selling.Value = 0
			end
		end
	end
end)

4 comments

0

money.Value += cost

0

it says Syntax error: Expected identifier when parsing expression, got "+="

0

Not "money.Value = money.Value += 1". It's just "money.Value += 1"

0

I had no idea compound operators were added, im glad i saw your comment.