Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Unable to cast value to Object?

What happening?

script.Parent.MouseClick:connect(function()
	game:GetService("ReplicatedStorage"):FindFirstChild("OnEat"):FireClient("eat")
end)


1 comment

0

script/local script?

1 answer

The function “:FireClient(playerToSendTo, additionalArguments)” starts with the player, not the arguments.

RemoteEvent:FireClient(Player,”eat”)

It gives “unable to cast value to object” because its expecting the “Player” object but gets the string “eat” in its place.

2 comments

0

Now it does nothing

0

How are you getting the player?l

This discussion is preserved as it was. New answers, comments, and votes are closed.