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

Running fireclient says that its nil?

Im trying to run FireClient() but its not working. This is the first time I used it, so im not totally sure how to use it. This is my error: Argument 1 missing or nil. Here's my code

local event = game.ReplicatedStorage:WaitForChild("ClosedEvent")
script.Parent.MouseButton1Click:Connect(function()
	event:FireClient()
	script.Parent.Parent.Parent:Destroy()

end)

1 comment

1

2 things, fireclient takes the player you're sending the signal to as the first argument, ANND you cannot use fireclient except from a localscript

1 answer

✓ Accepted answer

First of all, you don't need WaitForChild in a variable. Now to address your problem, are you sure the error is that script, I'm pretty the error is in the client script, if it is put player in the brackets.

if I helped please accept this answer!

2 comments

0

Thanks, sorry I wasn't at my pc. Also, can a remote event be used for a local script to a normal script? Or is it just vice versa?

0

A remote event can be used from a local script to a server script, and from a server script to a local script. Please don't hesitate to ask any more questions! :)

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