So i’ve run into an error that I cannot explain to myself and didn’t find a solution for.
I’m trying to pass a proximity prompt from the server to the client through a remote event, but for some reason the client only receives nil as an argument. Heres the script:
print(prompt) -- the prompt is being printed
Remotes.EnablePrompt:FireClient(player, prompt)
Client:
Remotes.EnablePrompt.OnClientEvent:Connect(function(prompt)
print("Event fired",prompt) -- prompt is being printed as nil
if not prompt then return end -- code stops here
prompt.Enabled = true
print("Promp Enabled")
end)
If the player is not referenced properly in the server script, then the client script would never receive the signal and would print nothing at all, not even a nil
Client script doesnt receive the player as the first param, it only needs to be function(prompt)
also I just realized, if this is a Prompt, you didn’t need to have a remote event to enable the Prompts from the server to the client (unless you needed the server to reference something as user owns gamepass or user is in this specific group rank).
you can just return true or false variables/param from the server since that’s much more easier for it to read instead of sending a stringValue (got me so complicated in doing stringValue params)
I think thats the main issue, lack of context of OP’s script. I experienced little issues with passing instances from server to client in the past, but I just tested it, the prompt can be sent normally without any additional need.
I wanna guess that is something related with enable them from server for a specific, but yeah you have a point, perhaps @TTTDeathwish1 is not using the default functions of the ProximityPrompt.
If prompt is an Instance then this is likely because the Prompt only exists on the server (ie: it’s parented to ServerStorage or ServerScriptService). You cannot replicate instances like this on Roblox.