Attempt to compare number <= Instance

I am making garage and I have a problem

game.ReplicatedStorage.Colour.OnServerEvent:Connect(function(plr, state, colour, state2)
	print("Recieved")
	if state == false then
		print("state false")
			if Player == plr.Name then
				print("Player true")
				if Body then
					print("Body true")
					if state2 then
						if state2 == true then
							for i,v in pairs(Body:FindFirstChild("Paint", true):GetChildren()) do
								v.Color = OriginalColour
							end
						end
					else
						for i,v in pairs(Body:FindFirstChild("Paint", true):GetChildren()) do
							v.Color = colour
						end
					end
				end
		end
	else
		if plr.leaderstats.Money >= 500 then -- this is line 66
			plr.leaderstats.Money = plr.leaderstats.Money - 500
			wait(0.5)
			
			for i,v in pairs(Body:FindFirstChild("Paint", true):GetChildren()) do
				v.Color = colour
				OriginalColour = v.Color
			end
		else
			for i,v in pairs(Body:FindFirstChild("Paint", true):GetChildren()) do
				v.Color = OriginalColour
				game.ReplicatedStorage.ShowWheel:FireClient(game.Players:FindFirstChild(Player), false)
			end
			
		end
	end
end)

image

I think it is this line here:

Money is the actual object, not the value. You would need to do plr.leaderstats.Money.Value instead to get the value.

4 Likes