I am making a game where it randomly selects a role, this works fine, except I am trying to enable a script for that specific role which isn't working. I am trying to change the text of a text label to read the role of the player, my thoughts were that I enable another script which is named the role, and in that script it fires a remote event which changes the text via a local script, if anyone could help me with this script or give me some advice of how I could pass the role through a remote event I would greatly appreciate it! Thanks!
game.Players.PlayerAdded:Connect(function(plr)
local Roles = game.ReplicatedStorage:WaitForChild("Roles"):GetChildren()
local Role = Roles[math.random(1,#Roles)]
game.ReplicatedStorage:WaitForChild("Roles"):WaitForChild(Role).Disabled = false
print(Role)
end)

1 comment
Hey about whenever the regular players spawn it destroys all the role scripts server side and whenever the role player spawns it doesnt destroy their script?