Jump to content

Drop all items in players inventory.


RG2N2

Recommended Posts

Code:

on death:
    execute console command "smite %victim%"
    cancel event
    set player's gamemode to spectator
    send title "&4&lYou died!" with subtitle "5 seconds until respawn." to player for 1.5 seconds
    wait 1 second
    send title "&4&lYou died!" with subtitle "4 seconds until respawn." to player for 1.5 seconds
    wait 1 second
    send title "&4&lYou died!" with subtitle "3 seconds until respawn." to player for 1.5 seconds
    wait 1 second
    send title "&4&lYou died!" with subtitle "2 seconds until respawn." to player for 1.5 seconds
    wait 1 second
    send title "&4&lYou died!" with subtitle "1 seconds until respawn." to player for 1.5 seconds
    wait 1 second
    set player's gamemode to survival
    execute player command "spawn"
    send title "&a&lRespawned!" with subtitle "You have been sent back to spawn." to player for 2 seconds

I tried drop all items in players inventory, nothing happens and nothing drops. How can I make all of there items drop?

Link to comment
Share on other sites

Hey there,

loop all items in victim's inventory:
	drop loop-value at victim
	set slot index of loop-value of victim to air

Add this to the part before the title messages.

Edited by _omga

If I helped you at all, leave a like!

IGN: _omga
Discord: omega#1000

 

Link to comment
Share on other sites

  • 2 weeks later...
On 3/5/2021 at 11:46 AM, _omga said:

Hey there,


loop all items in victim's inventory:
	drop loop-value at victim
	set slot index of loop-value of victim to air

Add this to the part before the title messages.

Doesn't work. Why does this always happen with minehut forums but never happens with the skript forums. why

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...