GiveItem sets velocity.
Give every player 10 confetti on greet for hype.
This commit is contained in:
parent
d71aacc58d
commit
f21adbfc42
2 changed files with 5 additions and 0 deletions
|
|
@ -633,6 +633,8 @@ namespace TShockAPI
|
|||
Main.item[itemid].stack = stack;
|
||||
Main.item[itemid].owner = Index;
|
||||
Main.item[itemid].prefix = (byte) prefix;
|
||||
Main.item[itemid].noGrabDelay = 1;
|
||||
Main.item[itemid].velocity = Main.player[this.Index].velocity;
|
||||
NetMessage.SendData((int)PacketTypes.ItemDrop, -1, -1, "", itemid, 0f, 0f, 0f);
|
||||
NetMessage.SendData((int)PacketTypes.ItemOwner, -1, -1, "", itemid, 0f, 0f, 0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1079,6 +1079,9 @@ namespace TShockAPI
|
|||
player.Teleport(pos.X*16, pos.Y*16 + 48);
|
||||
}}
|
||||
|
||||
Item i = new Item();
|
||||
i.SetDefaults("Confetti Gun");
|
||||
player.GiveItem(i.type, i.name, i.width, i.headSlot, 10);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue