Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Give random item for Player
#3
Correct

Squirrel Script
  1. local items =
  2. [
  3. "ITMI_GOLD",
  4. "ITFO_APPLE",
  5. "ITFO_MILK",
  6. "ITFO_BEER", // this comma is optional
  7. ];
  8.  
  9. addEventHandler("onPlayerJoin",function(pid)
  10. { // below code will be executed when player join to the server
  11. local item = rand() % items.len();
  12.  
  13. giveItem(pid, Items.id(items[item]), 1);
  14. });


Reply


Messages In This Thread
Give random item for Player - by liegav - 12.02.2018, 22:13
RE: Give random item for Player - by Patrix - 12.02.2018, 23:20
RE: Give random item for Player - by Profesores - 13.02.2018, 01:13
RE: Give random item for Player - by liegav - 13.02.2018, 06:43
RE: Give random item for Player - by Patrix - 13.02.2018, 10:17
RE: Give random item for Player - by Patrix - 14.02.2018, 18:30

Possibly Related Threads…
Thread Author Replies Views Last Post
  Give- / Removeitems on Focus ItschiAtschiUtschi 3 2,424 10.06.2020, 16:04
Last Post: Patrix
  how do I Kill a player on the client side? demor140202 4 3,664 24.02.2020, 12:32
Last Post: Patrix
  Random spawn players demor140202 5 4,207 10.02.2020, 07:37
Last Post: Quarchodron
  Short question about Gold, how to give it ? Mattwell 2 3,430 26.01.2018, 00:12
Last Post: Mattwell
  Dev 8 item synchronisation HammelGammel 0 2,008 21.01.2017, 11:04
Last Post: HammelGammel
  Default world Item Xardas0327 1 2,162 21.03.2016, 13:51
Last Post: Bimbol
  Random Number Osmith 5 4,596 20.02.2016, 14:21
Last Post: Blacha

Forum Jump:


Users browsing this thread: 1 Guest(s)