Remove Item From hero

theonlylok1

New Member
Reaction score
0
Hey, I need help I need to make it so if a player types -D1 through -d6 it will destroy there heros item of that slot, because i made it when they save it makes the items undropable to keep from item dupes, however i dont know how to make it declaire what hero they are using they will have one hero but many dummies around so i dont want it to interfere with the dummies
 
K

Kerberos

Guest
This should work. "Heroes" is a unit array where Heroes[x] is the hero being controlled by player number x.
Code:
Events
    Player 1 (Red) enters a chat message containing -d as A substring
    Player 2 (Blue) enters a chat message containing -d as A substring
    Player 3 (Teal) enters a chat message containing -d as A substring
    ...
Conditions
Actions
    Item - Remove (Item carried by Heroes[(Player number of (Triggering player))] in slot (Integer((Substring((Entered chat string), 3, 3)))))
 

theonlylok1

New Member
Reaction score
0
Didnt Seem to work.

JASS:
Item
    Events
        Player - Player 1 (Red) types a chat message containing -d as An exact match
        Player - Player 2 (Blue) types a chat message containing -d as An exact match
        Player - Player 3 (Teal) types a chat message containing -d as An exact match
        Player - Player 4 (Purple) types a chat message containing -d as An exact match
        Player - Player 5 (Yellow) types a chat message containing -d as An exact match
        Player - Player 6 (Orange) types a chat message containing -d as An exact match
        Player - Player 7 (Green) types a chat message containing -d as An exact match
        Player - Player 8 (Pink) types a chat message containing -d as An exact match
        Player - Player 9 (Gray) types a chat message containing -d as An exact match
        Player - Player 10 (Light Blue) types a chat message containing -d as An exact match
    Conditions
    Actions
        Item - Remove (Item carried by Heros[(Player number of (Triggering player))] in slot (Integer((Substring((Entered chat string), 3, 3)))))


This Seems to have done nothing =( Did it exactly as you said.

Edit* Do I have to tell the game what heros each player is using?
Because it will be difficult because it is an oRPG and the heros are always diffrent for each player each game.
 

xAnaMorphine

Active Member
Reaction score
43
I will try to figure out what you are trying to say.. I am still a noobie

Edit* Lol I am so lost =/ what am I missing here?

This isn't that hard, is it?

You made the trigger look like this:

Item
Events
Player - Player 1 (Red) types a chat message containing -d as An exact match
Player - Player 2 (Blue) types a chat message containing -d as An exact match
Player - Player 3 (Teal) types a chat message containing -d as An exact match
Player - Player 4 (Purple) types a chat message containing -d as An exact match
Player - Player 5 (Yellow) types a chat message containing -d as An exact match
Player - Player 6 (Orange) types a chat message containing -d as An exact match
Player - Player 7 (Green) types a chat message containing -d as An exact match
Player - Player 8 (Pink) types a chat message containing -d as An exact match
Player - Player 9 (Gray) types a chat message containing -d as An exact match
Player - Player 10 (Light Blue) types a chat message containing -d as An exact match
Conditions
Actions
Item - Remove (Item carried by Heros[(Player number of (Triggering player))] in slot (Integer((Substring((Entered chat string), 3, 3)))))

But instead of this:

Player - Player 1 (Red) types a chat message containing -d as An exact match

You should write for all this:

Player - Player 1 (Red) types a chat message containing -d as A substring

And the result should look like this:
Events
Player - Player 1 (Red) types a chat message containing -d as A substring
Player - Player 2 (Blue) types a chat message containing -d as A substring
Player - Player 3 (Teal) types a chat message containing -d as A substring
Player - Player 4 (Purple) types a chat message containing -d as A substring
Player - Player 5 (Yellow) types a chat message containing -d as A substring
Player - Player 6 (Orange) types a chat message containing -d as A substring
Player - Player 7 (Green) types a chat message containing -d as A substring
Player - Player 8 (Pink) types a chat message containing -d as A substring
Player - Player 9 (Gray) types a chat message containing -d as A substring
Player - Player 10 (Light Blue) types a chat message containing -d as A substring
Conditions
Actions
Item - Remove (Item carried by Heros[(Player number of (Triggering player))] in slot (Integer((Substring((Entered chat string), 3, 3)))))

GL
 
K

Kerberos

Guest
Or remove item from selected hero if there are more than one.
Mm, that would be a good idea. Except you'd need to guarantee that the selected hero belongs to the triggering player or all sorts of funny things could happen.
 

theonlylok1

New Member
Reaction score
0
Thanks, i sort of over looked that *Slams Head* Thanks

Edit* Got it to work thanks sorry about earlier it was like 3:30AM and I had a long day at work thanks for the support +rep
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top