Author Topic: Giving players items  (Read 1097 times)

How do you make it so on a trigger you get sertain weapons?

Code: [Select]
%itemdatablock="sworditem";
%player.tool[0]=nametoid(%itemdatablock);
messageClient(%player.client, 'MsgItemPickup', '', 0, nametoid(%itemdatablock));

That puts a sword in your first slot, so I'd figure you would loop through each inventory when a player enters the trigger, find one thats empty, and put in the item.

Was it to hard to look in a script that you know gives an item?


@ MrPickle:

Btw, Ephi keeps a card catalog (read: he's able to use the search function) of everything that happens on the forum.  If you do something stupid, he'll make sure that more than one person sees it.

Tell ya what, maybe if you start all your coding help topics from now on with "I'm in a pickle.", he can cut you some slack.  I don't know about Ephi, but I would lol.

:cookieMonster:

I had a completely different issue to what he's asking.

I knew how to add items to the inventory, once again, Ephi fails to read properly.

I would agree with Trader.

Correct me if i am wrong, but your thread was asking for help on why you could not put an item in the 4th slot of the inventory - this would immediately signal you do not know how to put items into the inventory. Upon looking at your code i then discovered you were just doing a messageclient to update their inventory, but you were not doing %player.tool[num] = toolid;

This also signals you did not know how to add items to the inventory.

Finally, you claimed that the messageClient added the items to your inventory on the server, and that the %player.tool[num] = toolid; line is not needed - which is clearly not true - and you later admitted this and added the %player.tool[num] = toolid; line into your script. At this point it is now blatantly obvious that you did not know how to add tools to the inventory.

I think that clears that one up, once again Pickle fails to own understand his own problems.
« Last Edit: January 23, 2008, 11:26:06 AM by Ephialtes »

I was playing single player, try it, it does update server in single player.

I had also said I had tried adding that but then the gui doesn't update. I later realized after looking at some other scripts, like I advised, I was sending the wrong variable because I had copy and pasted it from a script that was using the client's object, not the players.

I had a completely different issue to what he's asking.

I knew how to add items to the inventory, once again, Ephi fails to read properly.

Just like you did in my thread? Once again, hypocrisy.