Server not enabling other local script

What do you want to achieve?
I want the script Chosen to enable. There are also no errors

**What is the issue?
it does NOT enable. the script is in server script.

What solutions have you tried so far?
I tried using a remote event when it fires the script enables but that does not work.

The script

local players = game.Players:getPlayers()

for _,player in pairs(players) do
	player.Character.Chosen.Disabled = false
end

If someone could help it would be appreciated :slight_smile:

Can you show us the explorer (with the the vital scripts visible)?

It is pretty much a script in server script service and a script in the player character called chosen.

local players = game.Players:getPlayers() -- Table is empty on server start. Players joining / removing doesn't add/remove the player to the table.

for _,player in pairs(players) do
	player.Character.Chosen.Disabled = false
end -- Won't do anything, because there aren't any players on the server at the start. 
-- Also the script isn't located in the player's character if they are fully loaded in.

the script only activates when a remote event fires

I’m very confused.

Can you show me the full script if you are implying that there is a RemoteEvent coded in?

Im assuming the local script chosen shows a gui that says they are Chosen? There are better ways to interact with a client.

no it just enables the script. the script allows the player to walk through a part

Still a better way to tell the client to do that.

BindableEvent.Event:Connect(function() -- Do not use RemoteEvent, it's for server-client communication.
  for _, Player in pairs(game.Players:GetChildren()) do
    Player.PlayerScripts.Chosen.Disabled = false
    -- Or if in character: Player.Character:FindFirstChild("Chosen").Disabled = false
  end
end)

Step 1: Make a remote event named ChosenEvent and put it in replicated storage.

Step 2: Place a local script into where you need it for the client. Put this code into the local script:

local remote = game:GetService("ReplicatedStorage"):WaitForChild("ChosenEvent")

remote.OnClientEvent:Connect(function()

-- do what ever you need to do on the client

end)

Step 3: Place a normal script into serverscriptservice. Put this code inside:

local remote = game:GetService("ReplicatedStorage"):WaitForChild("ChosenEvent")


remote:FireClient(player) -- Run this code to do the cgosen thing on the client