Help with "unable to cast value to object" error

Hello, I made a script which will say the name of the model in a remote event which will then be taken care of by this script. I took “func”, this represents the name of the model (the message said by the server). Why does it show me “unable to cast value to object”?
Capture d'écran_20230125_184720


Thank for help.

I don’t understand, at what line is the error occuring?

Are you referring to the :FireServer()?

Can you show the Connection of the Event?

Oh sorry I forgot that
Capture d'écran_20230125_185607
Ligne 5…

ok so, the First thing I notice is that you don’t have a Player Instance

Unlike FireServer, FireClient with the exception of FireAllClients requires a Player so the Event knows who to fire to, remove the Player event from the OnClientEvent as it is not already specified.

You’ll Need to specify that Argument with FireClient

function onTriggered(Player)
    event:FireClient(Player, "TurnstilesV1")
end

Use FireAllClients if you intend to Fire for all Players

image
Ok, so I think it works.

For future references, don’t post images of your code (its against the guidlines for this section).
Instead, paste your code and put ``` on each side of your code.

Example:
Heres what I did:
image_2023-01-25_140536933

--Here's what it turns it into:
print("Hello World")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.