1
0

20 lines
688 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Function: HasCoin(Spawn, Value)
Description: Checks if a player (Spawn) has at least a certain amount of coin (Value in copper) on them.
Parameters:
Spawn: Spawn The player whose coin purse to check.
Value: Int32 The amount of coin (in copper units) to check for.
Returns: Boolean true (1) if the player has at least that amount of coin; false (0) if they do not have enough money.
Example:
-- Example usage (charging a fee if the player can afford it)
if HasCoin(Player, 5000) then -- 5000 copper = 50 silver
RemoveCoin(Player, 5000)
SendMessage(Player, "You pay 50 silver for the item.")
else
SendMessage(Player, "You don't have enough coin.")
end