Hello everyone ! I am looking to make a selection of random roles. I have a problem : That is the role does not get deleted once it is distributed to a player. So, another player can get the same role.
I'm trying to do that once the role is obtained by one player, a other player can't not get it
Code:
Thank's !
I'm trying to do that once the role is obtained by one player, a other player can't not get it
Code:
code_language.skript:
function BroadcastRoles(p: player):
add "Knight" to {_roles::*}
add "Villager" to {_roles::*}
add "Shepherdess" to {_roles::*}
while {searching_roles.%{_p}%} is true:
set {_r} to random object out of {_roles::*}
set {Game.Role::%{_p}%} to {_r}
remove {_r} from {_roles::*} #It does not work
send {_p} title "" with subtitle "&7&oYou got your role..." for 5 seconds
skellett play skellett sound "LEVEL_UP " to {_p} with volume 1.5 and pitch 3
send "&e&lYou are : %{Game.Role::%{_p}%}%" to {_p}
set {searching_roles.%{_p}%} to false
command /rolesdefine:
trigger:
loop all players:
set {searching_roles.%loop-player%} to true
BroadcastRoles(loop-player)
Thank's !
Last edited: