Solved help with a roles 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 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!

kkona

Member
Jul 16, 2023
4
0
1
So I have this roles skript and it was working fine until another player joined and was assigned a role then the game wouldnt tell me that i had my role. I then opend it up on a test server and tried again with the same skript (without anyone else receiving a role) and it worked fine.


Code:
function BroadcastRoles():
    add "test1", "tes2" and "test3" to {_roles::*}
    loop all players:
        set {_p} to loop-player
        set {_r} to random object out of {_roles::*}
        set {Game.Role::%{_p}%} to {_r}
        remove {_r} from {_roles::*}
        play sound "entity.player.levelup" to {_p}
        send "&e&lYou are : %{Game.Role::%{_p}%}%" to {_p}

command /rolesdefine:
    trigger:
        BroadcastRoles()

on leftclick holding melon:
  if {Game.Role::*} is "test1":
    send "you are a test1!" to player
  else:
    send "you arent a test1 silly"


on leftclick holding carrot:
  if {Game.Role::*} is "test2":
    send "you are a test2!" to player
  else:
    send "you arent a test2 silly"

on leftclick holding pumpkin:
  if {Game.Role::*} is "test3":
    send "you are a test3" to player
  else:
    send "you arent a test3 silly"
 
I asked chatgpt and it managed to fix it
1689590820909.png
 
GPT does understand skript and recognizes it as a programming language, it isnt perfect but it does work very well, also I tried it initally as a joke, and it did return a functioning skript!
 
Never said it was. What I meant was GPT recognizes it as a programming language, its pretty bad at skript but it can do basic stuff.