#Variable issue

1 messages · Page 1 of 1 (latest)

glossy shard
#
        cancel event
        close inventory of player
        
        if event-slot is 10:
            if player has permission "privatearena.tank.grass":
                if {_arg} is not set:
                    clear inventory of player
                    clear all the potion effects of player
                    heal player
                    execute console command "/playerkits give tank %player%"
                    execute console command "/warp tankgrassca %player%"
                    send "&bTeleported to the arena." to player
                
                if {_arg} is set:
                    set {tank::grassland::%player's uuid%} to true
                    send "" to {_arg}
                    send "&b&lPrivate Arena Request" to {_arg}
                    send "" to {_arg}
                    send "&b%player% &fhas invited you to &bGrassland Arena &ffor a &bTank &fduel." to {_arg}
                    send "" to {_arg}
                    send "&a<command:/accept>[Accept]<reset>   &7or   &c<command:/reject>[Reject]<reset>" to {_arg}
                    wait 10 seconds
                    set {tank::grassland::%player's uuid%} to false
                    send "&cTeleport request expired." to {_arg}
            else:
                send "&cYou don't have the permission to use this."
command /accept:
    trigger:
        set {_arg} to player
        if {tank::grassland::%player's uuid%} is true:
            clear inventory of player
            clear all the potion effects of player
            heal {_arg}
            execute console command "/playerkits give tank %{_arg}%"
            execute console command "/warp tankgrassca %{_arg}%"
            send "&bTeleported to the arena."
            set {tank::grassland::%player's uuid%} to false
            stop
        else:
            send "&cYou are not allowed to use this command now."
            stop```
#

When the player clicks on Accept [makes him send command /accept]. It sends "You are not allowed to use this command now" [which should be sent when the the variable isn't set to true]

#

Someone please help me figure out the issue.

dry token
#

what do u want to set to true

glossy shard
#

{tank::grassland::%player's uuid%}

dry token
#

it's already set to true?

glossy shard
#

I have set it to true and like assigned some action but it doesn't happen

#

It sends "You are not allowed to use this command now" [which should be sent when the the variable isn't set to true]

dry token
#

@soft dirge

#

he knows more than me

#

he should be able to fix it

glossy shard
#

Oh alr.

dry token
#

i don't work with {_arg} and stuff

glossy shard
#

It is a variable

dry token
#

ik

#

wait

#

is that the player?

glossy shard
#

{_arg} is a player in my skript

#

yes

dry token
#

ohh

#

so if he clicks on accept u want it to execute the player command /accept?

glossy shard
#

Yes.

dry token
#

and u can't figure it out how?

glossy shard
#

I think so it happens but the process after this isn't getting followed

dry token
#

what skript r u making

#

so i know what to do

#

kk lemme try to fix it rn

glossy shard
#

So this is a skript for private arenas.
so /arena opens a gui for Player A who has perms to use it. Using that gui Player A can select a gamemode like tank, netherite pot and an arena to send a teleport request to player B

#

PLayer B which is arg-1 of command /arena gets a teleport request which he/she can accept or reject

#

I hope this gives you an idea about the skript.

#

My full code is 400+ lines and I am not sending it here because it might be a pain to view it.

dry token
#

true

glossy shard
#

If you want to load the skript then lmk, I will send it 😄

dry token
#

the skript had so many errors

#

did you test it out?

glossy shard
#

No errors are there

dry token
#

what version of skript are you using

glossy shard
#

Not sure about the version but this is the file.

dry token
#

do /skript info

#

in-game

glossy shard
#

I have updated the version to

#

Skript 2.8.2

midnight ivy
#

have you tried debugging?

glossy shard
midnight ivy
#

i mean

#

have you added broadcast in to see what values are, and which conditions are passed?

glossy shard
glossy shard
midnight ivy
#

Well, debug again