so I made role randomizer to my game, but it only appears for one player at once, and after animation for one player is finished, then it appears for another player. is it possible to make it appear for every player at same time without local scripts?
code:
local function roleSelecting(player)
local role = player.PlayerGui:WaitForChild("MainMenu").RoleSelect
role.Visible = true
for i = 1, 0, -0.02 do -- screen fades to black
wait()
role.BackgroundTransparency = i
end
if player.Objectives.Role.Value == "FirstRole" then -- checks for roles
game:GetService("TweenService"):Create(role.FirstRole, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {TextTransparency = 0}):Play()
wait(6)
game:GetService("TweenService"):Create(role.FirstRole, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
elseif player.Objectives.Role.Value == "SecondRole" then
game:GetService("TweenService"):Create(role.SecondRole, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {TextTransparency = 0}):Play()
wait(6)
game:GetService("TweenService"):Create(role.SecondRole, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
end
end
for i, player in pairs(game.Players:GetPlayers()) do
roleSelecting(player)
end