I am making a tycoon, and I have a script to make a wall appear when the player has a certain amount of money, but There keeps being a red line under the minus symbol. Heres the script:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player.leaderstats.Cash.Value >= 1000 then game.Workspace.wall.CanCollide = true game.Workspace.wall.Transparency = 0 player.leaderstats.Cash.Value - 1000 -- Here is the error. The minus is squiggled. end end end)
You need to change it to
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 1000
You need to subtract it this way otherwise it would not work.