please help i don't understand (among us skript)

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

Witchery

Member
Feb 5, 2019
2
0
1
25
I save the location on behalf of the player then I want to use it.

Code:
if victim is not {impostor} or {impostor2}:
    set {location.%victim%} to victim's location
    set {x.%victim%} to x coord of {location.%victim%}
    set {y.%victim%} to y coord of {location.%victim%}
    set {y2.%victim%} to {y.%victim%} +1
    set {z.%victim%.%victim%} to z coord of {location.%victim%}
    set {location2.%victim%} to location {x.%victim%}, {y.%victim%}, {z.%victim%} in world of victim

I am using this elsewhere:

Code:
on rightclick:
    if clicked block is Player Head:
        set block at location at {x.%player%}, {y.%player%}, {z.%player%} in world "theSkeld" to air
        set block at location at {x.%player%}, {y2.%player%}, {z.%player%} in world "theSkeld" to air

Problem:

If only the player in% player% right clicks, the block is air. So %player% so % victim% doesn't work if an external player right clicks.
 
Try this:
Code:
if victim is not {impostor} or {impostor2}:
    set {x.%victim%} to x coord of {location.%victim%}
    set {y.%victim%} to y coord of {location.%victim%}
    set {y2.%victim%} to {y.%victim%} +1
    set {z.%victim%.%victim%} to z coord of {location.%victim%}
    set {%{location.%victim%}%.victim} to victim's location
    

on rightclick:
    if clicked block is Player Head:
        if {%{location.%victim%}%.victim} is set:
            set {_p} to {%location%.victim}
            set block at location at {x.%{_p}%}, {y.%{_p}%}, {z.%{_p}%} in world "theSkeld" to air
            set block at location at {x.%{_p}%}, {y2.%{_p}%}, {z.%{_p}%} in world "theSkeld" to air
 
Status
Not open for further replies.