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"