Why My Script Subtract From The Leaderstat?

Hello! I am making a game where I have a proximity prompt that gives the player money. That proximity prompt works. But when I made the same one for subtracting money, it doesnt. There are no error messages. Whats going on?

Here is the code:

script.Parent.Triggered:Connect(function(player)
	local playerStats = player:FindFirstChild("leaderstats")
	local money = playerStats:FindFirstChild("Money")

	if money >= 10 then
		money.Value = money.Value - 10
	end
	
	
	
end)
if money >= 10 then

Should compare Value

if money.Value >= 10 then
2 Likes

Thanks a tun! Im making a really crazy game

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.