Jump to content

Withdrawal skript


EllWasHere2

Recommended Posts

I want to create a skript that withdraws a custom money item. There is a text form and an item form. The money item itself is $100, which would create problems, such as if the player had $150 in text form but only got the $100 in item form. To combat this, I created a custom coin item that was worth 1 cent each.

I'll get to the point. When I run /withdraw <integer>, I divide the integer provided by 100 (since the money item is worth $100) and I get a number with a decimal point which indicates cents.

For example: A player is withdrawing $121 in text form. Then, divide that by 100, 1.21. The 1 indicates 1 money item and the decimal indicates the amount of cents the player is getting, 21. One problem though. I do not know how to seperate the number from the decimal in this case. Is there a way to do it?

TL;DR I want to know how to seperate a number from its decimal. (e.g. 1.21, set {1} to the number and {21} to the decimal point.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...