Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I'm trying to figure out the whole substring thing for my map. I'm trying to make a command that when typed, will give the amount of gold to the player, providing the typer has the amount of gold. First, I'm trying to figure out how to use the substring stuff. This is what I tried.
(If you're wondering, for right now I made it give gold to myself so that I could test it myself)
Gold
Events
Player - Player 1 (Red) types a chat message containing -gold 02 as An exact match
Conditions
Actions
Set GOLDINT = (Substring((Entered chat string), 8, 9))
Player - Add (Integer(GOLDINT)) to Player 1 (Red) Current gold
I want it so that -gold 02 05 for example would give player 2, 5 gold.
Also, I'm not sure how to check if player 1 has enough gold to give to blue.
If you are not sure how SubString works then make a sandbox map:
Show the string Substring(("123456789"), 8, 9) on the screen
If you want to specify the amount of gold and the player too you'll need to use a chat command like this:
-gold p01 550 (gives 550 gold to red)
OR
-gold red 550 (does the same)
or something like that.
To check if player blue has enough gold or not:
Gold amount is an integer hard coded variable. You can find it under Integer Comparision / Player Property.
Remove the Do Nothing's.
Change 0X (player number) to X and then put it all into a loop, no need to create a new copy for each player.
Change the money checker (10-12) to 10 - Length of the string.
Remove the Do Nothing's.
Change 0X (player number) to X and then put it all into a loop, no need to create a new copy for each player.
Change the money checker (10-12) to 10 - Length of the string.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.