Solved codes not working

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Deavil

Member
Jun 4, 2019
36
0
6
23
hey, so i have got 2 codes that for some reason aren't working, 1 of which worked before but then stopped working.

the first one that worked before and stopped working is this:
code_language.skript:
on death:
   victim is a player
   if {dhead} is "floor":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       drop {_head} named "%victim%'s Head" at location of victim
   else if {dhead} is "fence":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       set {_location} to victim's location
       set {_x} to x coord of {_location}
       set {_y} to y coord of {_location}
       set {_y} to {_y} +1
       set {_z} to z coord of {_location}
       set {_location2} to location {_x}, {_y}, {_z} in world of victim
       wait 1 second
       set block at {_location} to nether brick fence
       set block 1 meter above {_location} to skull of {_head}
the first part works fine, but the second part where dhead is fence, it all works up until the set block 1 metar above location to skull, it wont place the skull at all




second code is a fly command which for some reason isn't doing anything, iv tried looking up something but every fly skript is only towars the command sender and mine is also to set to a certain player their fly mode on
here is the code:
code_language.skript:
command /fly [<offlineplayer>]:
   permission: {@PermCo}
   permission message: {@Permsg}
   trigger:
       if arg-1 is set:
           if {fly.%arg-1%} is false:
               set {fly.%arg-1%} to true
               send "%{fly.%arg-1%}%"
               set arg-1's fly mode to true
               message "{@P}{@C} Your Fly Mode Was Enabled By %command sender%" to arg-1
               message "{@P}{@C} You Enabled %arg-1%'s Fly Mode" to command sender
               stop
           else if {fly.%arg-1%} is true:
               set {fly.%arg-1%} to false
               set arg-1's fly mode to false
               message "{@P}{@C} Your Fly Mode Was Disabled By %command sender%" to arg-1
               message "{@P}{@C} You Disabled %arg-1%'s Fly Mode" to command sender
               stop
       else if arg-1 is not set:
           if {fly.%player%} is false:
               set {fly.%player%} to true
               set command sender's fly mode to true
               message "{@P}{@C} You Enabled Your Fly Mode" to command sender
               stop
           else if {fly.%player%} is true:
               set {fly.%player%} to false
               set command sender's fly mode to false
               message "{@P}{@C} You Disabled Your Fly Mode" to command sender
               stop

if someone could help fix these two codes please i will be more then thankful <3
 
hey, so i have got 2 codes that for some reason aren't working, 1 of which worked before but then stopped working.

the first one that worked before and stopped working is this:
code_language.skript:
on death:
   victim is a player
   if {dhead} is "floor":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       drop {_head} named "%victim%'s Head" at location of victim
   else if {dhead} is "fence":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       set {_location} to victim's location
       set {_x} to x coord of {_location}
       set {_y} to y coord of {_location}
       set {_y} to {_y} +1
       set {_z} to z coord of {_location}
       set {_location2} to location {_x}, {_y}, {_z} in world of victim
       wait 1 second
       set block at {_location} to nether brick fence
       set block 1 meter above {_location} to skull of {_head}
the first part works fine, but the second part where dhead is fence, it all works up until the set block 1 metar above location to skull, it wont place the skull at all




second code is a fly command which for some reason isn't doing anything, iv tried looking up something but every fly skript is only towars the command sender and mine is also to set to a certain player their fly mode on
here is the code:
code_language.skript:
command /fly [<offlineplayer>]:
   permission: {@PermCo}
   permission message: {@Permsg}
   trigger:
       if arg-1 is set:
           if {fly.%arg-1%} is false:
               set {fly.%arg-1%} to true
               send "%{fly.%arg-1%}%"
               set arg-1's fly mode to true
               message "{@P}{@C} Your Fly Mode Was Enabled By %command sender%" to arg-1
               message "{@P}{@C} You Enabled %arg-1%'s Fly Mode" to command sender
               stop
           else if {fly.%arg-1%} is true:
               set {fly.%arg-1%} to false
               set arg-1's fly mode to false
               message "{@P}{@C} Your Fly Mode Was Disabled By %command sender%" to arg-1
               message "{@P}{@C} You Disabled %arg-1%'s Fly Mode" to command sender
               stop
       else if arg-1 is not set:
           if {fly.%player%} is false:
               set {fly.%player%} to true
               set command sender's fly mode to true
               message "{@P}{@C} You Enabled Your Fly Mode" to command sender
               stop
           else if {fly.%player%} is true:
               set {fly.%player%} to false
               set command sender's fly mode to false
               message "{@P}{@C} You Disabled Your Fly Mode" to command sender
               stop

if someone could help fix these two codes please i will be more then thankful <3
1) You're using `skull of {_head}`, but `{_head}` is already a skull.
2) It's probably because the fly variable isn't set. You should use `set {var} to true` and `delete {var}` instead of true and false. Then you can simply check `if {var} is set:` and `else:`. Also, you don't need the stops since the other conditions have `else` in front of the ifs
 
1) You're using `skull of {_head}`, but `{_head}` is already a skull.
2) It's probably because the fly variable isn't set. You should use `set {var} to true` and `delete {var}` instead of true and false. Then you can simply check `if {var} is set:` and `else:`. Also, you don't need the stops since the other conditions have `else` in front of the ifs

the fly code has been fixed ty, however the head skript hasn't, i tried to do everything to set the skull of the victim to be on top of the nether brick fence and nothing happens, everything works fine up until it suppose to set the skull of the victim on top of the fence
 
the fly code has been fixed ty, however the head skript hasn't, i tried to do everything to set the skull of the victim to be on top of the nether brick fence and nothing happens, everything works fine up until it suppose to set the skull of the victim on top of the fence
Have you changed the code? If so, send it
 
code_language.skript:
on death:
   victim is a player
   if {dhead} is "floor":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       drop {_head} named "%victim%'s Head" at location of victim
   else if {dhead} is "fence":
       set {_location} to victim's location
       set {_x} to x coord of {_location}
       set {_y} to y coord of {_location}
       set {_y} to {_y} +1
       set {_z} to z coord of {_location}
       set {_location2} to location {_x}, {_y}, {_z} in world of victim
       set block at {_location} to nether brick fence
       set block 1 meter above {_location} to skull of "%victim%" parsed as offlineplayer
I only changed the variable part, so isn't of saving the victim's skull to the variable i tried to set it above the fence stright a way, didn't worl still sadlly
 
code_language.skript:
on death:
   victim is a player
   if {dhead} is "floor":
       set {_head} to skull of "%victim%" parsed as offlineplayer
       drop {_head} named "%victim%'s Head" at location of victim
   else if {dhead} is "fence":
       set {_location} to victim's location
       set {_x} to x coord of {_location}
       set {_y} to y coord of {_location}
       set {_y} to {_y} +1
       set {_z} to z coord of {_location}
       set {_location2} to location {_x}, {_y}, {_z} in world of victim
       set block at {_location} to nether brick fence
       set block 1 meter above {_location} to skull of "%victim%" parsed as offlineplayer
I only changed the variable part, so isn't of saving the victim's skull to the variable i tried to set it above the fence stright a way, didn't worl still sadlly
Why are you converting it to a string and then parsing is as an offline player? Why not use victim without that stuff?
 
Why are you converting it to a string and then parsing is as an offline player? Why not use victim without that stuff?
it worked like that before, but now it stopped woring, can u maybe show me what do i need to do to make it work?
 
it worked like that before, but now it stopped woring, can u maybe show me what do i need to do to make it work?
Yes try without that converting to text and parsing stuff
 
skript 2.2 fixes v8b, the code worked on that skript version but suddently stopped working
 
I tried doing that and it fucked up all my codes, none of my skripts were loading
 
Status
Not open for further replies.