Jump to content

this random kits skript i made doesnt seem to work in game and also whenever im op i cant die


greenspawner153alt

Recommended Posts

this is the skript:

on death of a victim:
    set {_randomNumber} to a random integer between 1 and 3 # Customize the range as needed
    if {_randomNumber} is 1:
        give victim iron sword
        give victim iron helmet
        give victim iron chestplate
        give victim iron leggings
        give victim iron boots
    else if {_randomNumber} is 2:
        give victim diamond sword
        give victim diamond helmet
        give victim diamond chestplate
        give victim diamond leggings
        give victim diamond boots
    else if {_randomNumber} is 3:
        give victim stone sword
        give victim leather helmet
        give victim leather chestplate
        give victim leather leggings
        give victim chainmail boots

 

if you know how to fix the other problem of me not being able to die if im in survival with op or when i /kill and i have op i wont die

Link to comment
Share on other sites

The player is already dead, so you can't give items to the player. Try respawn event, or on damage check if the damage is greater than the health of the player.

No rank - 2017-2021

Minehut Tester - 2021-2023

Minehut Volunteer Moderator - 2023-Current

Report a player/server: Report Player / Server

Create a support ticket: Submit a request

 

Did I help you? If so, feel free to give me a like!

Link to comment
Share on other sites

  • 2 weeks later...

on death of player:
    force event-player respawn
    wait 1 tick

    set {_randomNumber} to a random integer between 1 and 3 # Customize the range as needed
    {_randomNumber} is 1:
        give event-player iron sword
        give event-player iron helmet
        give event-player iron chestplate
        give event-player iron leggings
        give event-player iron boots
    else if {_randomNumber} is 2:
        give event-player diamond sword
        give event-player diamond helmet
        give event-player diamond chestplate
        give event-player diamond leggings
        give event-player diamond boots
    else if {_randomNumber} is 3:
        give event-player stone sword
        give event-player leather helmet
        give event-player leather chestplate
        give event-player leather leggings
        give event-player chainmail boots

Edited by Adramelke
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...