Atlathic
(Atlathix)
1
game.ReplicatedStorage.ToolEvents.BloxyColaEvent.OnServerEvent:Connect(function(player)
if player.leaderstats.Money.Value >= 3 then
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 3
game.ServerStorage.Tools.BloxyCola:Clone().Parent = player.Backpack
end
end)
Whenever I press the button, it fires the event but I do not get my Tool:
This error was showen up in the output:
ServerScriptService.BuyTools:4: attempt to compare number <= string
(the script in ServerScriptService is called BuyTools)
I cannot fix it.
TintinDevs
(TintinDevs)
2
Money.Value might be a string. Check your other scripts where you set Money.Value.
1 Like
Atlathic
(Atlathix)
3
Okay, im trying it right now. Thanks.
Atlathic
(Atlathix)
4
Tysm , I just found out when I created the leaderstats, I made a StringValue instead of a numberValue
Use IntValue to store money instead of a NumberValue. Since money should never require a decimal & will therefore always be an integer.
ye when i do the leaderstats i do IntValue instead of NumberValue