Special Abilitys

  • 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 community!

    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!

AdenR84

Active Member
Sep 4, 2023
112
1
18
i have this
on right click:
name of player's tool is "&f&lWool Sword &f&l✪"
if player's held item is arrow:
if {cooldown::%player's uuid%::bed} is greater than now:
cancel event
set {_waited} to difference between {cooldown::%player's uuid%::bed} and now
send "&cTry again in %{_waited}%!"
else:
set {cooldown::%player's uuid%::bed} to 45 seconds from now
name of player's tool is "&f&lWool Sword &f&l✪"
if player's held item is arrow:
if {mana.%player%} is greater than 34:
add -35 to {mana.%player%}
send "&4Used (Deep Sleep)! &b(-35 Mana)" to player
if {cooldown::%player's uuid%::bed} is greater than now:
cancel event
else:
send "&cYou don't have enough mana to do that!" to player
set block above event-location to air
set block above event-location to white bed
wait 10 seconds
message "&cYou Could not sleep in the bed in enough time it has parished."
set block above event-location to air
on right click on white bed:
heal player by 15 hearts
send "&cYou Are Well Rested. Healed 15 Hearts!" to player
set block at event-location to air
on right click:
name of player's tool is "&f&lCooldown Reset"
set {cooldown::%player's uuid%::bed} to 0 seconds from now
what im trying to do is make a bed that you can sleep in to gain health
my problem is that the cooldown and mana dosent cancel it and it says Your bed has perished after you've alr slept in it
 
i have this
on right click:
name of player's tool is "&f&lWool Sword &f&l✪"
if player's held item is arrow:
if {cooldown::%player's uuid%::bed} is greater than now:
cancel event
set {_waited} to difference between {cooldown::%player's uuid%::bed} and now
send "&cTry again in %{_waited}%!"
else:
set {cooldown::%player's uuid%::bed} to 45 seconds from now
name of player's tool is "&f&lWool Sword &f&l✪"
if player's held item is arrow:
if {mana.%player%} is greater than 34:
add -35 to {mana.%player%}
send "&4Used (Deep Sleep)! &b(-35 Mana)" to player
if {cooldown::%player's uuid%::bed} is greater than now:
cancel event
else:
send "&cYou don't have enough mana to do that!" to player
set block above event-location to air
set block above event-location to white bed
wait 10 seconds
message "&cYou Could not sleep in the bed in enough time it has parished."
set block above event-location to air
on right click on white bed:
heal player by 15 hearts
send "&cYou Are Well Rested. Healed 15 Hearts!" to player
set block at event-location to air
on right click:
name of player's tool is "&f&lCooldown Reset"
set {cooldown::%player's uuid%::bed} to 0 seconds from now
what im trying to do is make a bed that you can sleep in to gain health
my problem is that the cooldown and mana dosent cancel it and it says Your bed has perished after you've alr slept in it
Probably your indentation (and a couple of other stuff). I made a bit of a fix to your skript in the attachment. (Not tested btw)
 

Attachments

  • fix1-18634.sk
    2.5 KB · Views: 186
  • Like
Reactions: AdenR84
Hey @Doodle it worked amazingly but the sleeping in it does not work
could you replace my code for on right click bed with you while sleeping bed bc yours makes it so you need to sleep
but "You Can Only sleep at night" and can you help with if there is a block in the way and on the Parrish thing it still does that after the bed is gone and the angle of the bed should match the way your facing i thing right now it always does north could you fix that?
And Sry for The Late Response!
 
Hey @Doodle it worked amazingly but the sleeping in it does not work
could you replace my code for on right click bed with you while sleeping bed bc yours makes it so you need to sleep
but "You Can Only sleep at night" and can you help with if there is a block in the way and on the Parrish thing it still does that after the bed is gone and the angle of the bed should match the way your facing i thing right now it always does north could you fix that?
And Sry for The Late Response!
Ah, ok. Lemme fix it.
 
  • Wow
Reactions: AdenR84
Done! Hope it actually works this time!

Edit: I didn't know how to fix the angle thing, but I fixed if there is a block in the way and everything else.
 

Attachments

  • fix1-v1.1-18634.sk
    2.9 KB · Views: 210
nah still dont work but
i fixed i thing this i just need help on the spacing:
set {slept::%player's uuid%} to true
if name of player's tool is "&f&lWool Sword &f&l✪":
if player's held item is arrow:
if {cooldown::%player's uuid%::bed} is greater than now:
cancel event
set {_waited} to difference between {cooldown::%player's uuid%::bed} and now
send "&cTry again in %{_waited}%!"
else:
set {cooldown::%player's uuid%::bed} to 45 seconds from now
if {mana.%player%} is greater than 34:
add -35 to {mana.%player%}
send "&4Used (Deep Sleep)! &b(-35 Mana)" to player
set block above event-location to air
set block above event-location to white bed
on right click on white bed:
heal player by 15 hearts
send "&cYou Are Well Rested. Healed 15 Hearts!" to player
set block at event-location to air
set {slept::%player's uuid%} to false
wait 5 seconds
if {slept::%player's uuid%} is false
message "&cYou Could not sleep in the bed in enough time it has parished."
set block above event-location to air
else:
send "&cYou don't have enough mana to do that!" to player
# I combined your 'on right click' events because having two is quite chaotic.
else if name of player's tool is "&f&lCooldown Reset":
set {cooldown::%player's uuid%::bed} to 0 seconds from now