Client can not recevie intsances created/cloned by Server

The server creates a ProximityPrompt every time a character is added, and this ProximityPrompt is special for some players. Hence, I fire a RemoteEvent to hide it from other players. However, clients can’t see the ProximityPrompt. Why is that? Here is my code:

local prompt = Instance.new("ProximityPrompt", chr:WaitForChild("HumanoidRootPart"))

task.wait()
	
for i, player in pairs(Teams.A:GetPlayers()) do
	HidePrompt:FireClient(player, prompt) -- Nil for client
end

It works if I put a ProximityPrompt which already exists. But I need to clone them per character.
EDIT: I forgot to put player in the FireClient part but it is fixed in the Studio.

1 Like

:FireClient requires a Player argument so it knows which player to send it to, consider using:

HidePrompt:FireClient(player, prompt)
1 Like

I forgot to put it in the forum, I have the fixed version but still not working.

1 Like

Yeah it’s not working for me either. Probably some replication issue because there’s quite a few similar devforum articles with no solutions.

Despite it not being passed by the remote, I can still see it in client-view in the explorer, so you could try to send the HumanoidRootPart instead of the proximity, then :FindFirstChild('ProximityPrompt') in the OnClientEvent function and change it there.

Edit: Nevermind, try adding a bit more time to your wait:

My guess is that it’s firing the Instance to the client before the client has actually managed to replicate the ProximityPrompt.

Alternatively send the Player, repeat until Player.Character, and then :WaitForChild(‘ProximityPrompt’) in the Player.Character.HumanoidRootPart

1 Like