if Player.PlayerStats.CurrentValue < Player.PlayerStats.Storage.Value then
if Debounce == false then
Debounce = true
CoinClicked:FireServer(Strength.Value)
wait (0.25)
Debounce = false
end
-tell me what I have done wrong?
if Player.PlayerStats.CurrentValue < Player.PlayerStats.Storage.Value then
if Debounce == false then
Debounce = true
CoinClicked:FireServer(Strength.Value)
wait (0.25)
Debounce = false
end
-tell me what I have done wrong?
The error is right here:
if Player.PlayerStats.CurrentValue < Player.PlayerStats.Strength.Value then
Odds are that CurrentValue is either an IntValue or a NumberValue. If so, use its Value property to compare it with another value's Value property:
if Player.PlayerStats.CurrentValue.Value < Player.PlayerStats.CurrentValue.Value then
The error itself is self-explanatory: attempt to compare userdata with number. CurrentValue is an Instance, and because all Instances are userdata values, you are comparing two things with different data types. CurrentValue.Value is a number value, and should fix your problem.
This discussion is preserved as it was. New answers, comments, and votes are closed.