Solved on right click on any block

  • 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.

Mick

Member
Aug 23, 2018
1
0
0
25
Hey. i want to make a grave skript but i get errors any time :emoji_astonished: can anybody help me with this?
Here is my code:

on death:
set block at victim to victim's skull
set {grave.%block at victim%} to true
set {grave.owner.%block at victim%} to victim
setinv(victim)

on right click on any block:
if player is sneaking:
if {grave.%event-block%} is true:
if {grave.owner.%event-block%} is player:
set the helmet of player to {inv.%player%.helmet}
set the chestplate of player to {inv.%player%.chestplate}
set the leggings of player to {inv.%player%.leggings}
set the boots of player to {inv.%player%.boots}
set {_count} to 0
loop 36 times:
set slot {_count} of player's inventory to {inv.%player%.%{_count}%}
add 1 to {_count}
message "&7(&bGraves&7) &f- &7You picked up your grave"
else:
if player doesn't have permission "graves.get.other":
message "&7(&bGraves&7) &f- &7This is not your grave!"
else:
set the helmet of player to {inv.%{grave.owner.%event-block%}%.helmet}
set the chestplate of player to {inv.%{grave.owner.%event-block%}%.chestplate}
set the leggings of player to {inv.%{grave.owner.%event-block%}%.leggings}
set the boots of player to {inv.%{grave.owner.%event-block%}%.boots}
set {_count} to 0
loop 36 times:
set slot {_count} of player's inventory to {inv.%{grave.owner.%event-block%}%.%{_count}%}
add 1 to {_count}
message "&7(&bGraves&7) &f- &7You picked up &8%{grave.owner.%event-block%}%&7's grave"
function setinv(p: player):
set {_count} to 0
loop 36 times:
set {inv.%{_p}%.%{_count}%} to slot {_count} of {_p}'s inventory
add 1 to {_count}
set {inv.%{_p}%.helmet} to {_p}'s helmet
set {inv.%{_p}%.chestplate} to {_p}'s chestplate
set {inv.%{_p}%.leggings} to {_p}'s leggings
set {inv.%{_p}%.boots} to {_p}'s boots
on skript start:
loop all players:
if loop-player has permission "message.warn.see":
send "&7(&bGraves&7) &f- &7A grave can not be opened after a reload!" to loop-player

And the error:
can't understand this event: 'on right click on any block' (grave.sk, line 7: on right click on any block:')
 
Status
Not open for further replies.