Hello, so I started to learn how to use RemoteEvents and I have a problem. Can I get some help? Output : 14:00:54.333 - FireClient: player argument must be a Player object 14:00:54.333 - Stack Begin 14:00:54.333 - Script 'Workspace.Values.playerDied.Script', Line 10 14:00:54.333 - Stack End and my script that :FireClient() :

local event = workspace.plrDied
local val = script.Parent
local player = game.Players.LocalPlayer
event.OnServerEvent:connect(function()
	val.Value = true
end)

script.Parent.Changed:connect(function()
	if script.Parent.Value == true then
		workspace.plrDiedUI:FireClient(player)
	end
end)

If you need more info please tell me. I'm hoping for some help.

7 comments

0

is this all a local script?

3

I can see a multitude of problems. 1. You are have 2 different calls, you are firing from what appearts to be a LocalScript. You can't FireClient from Local Script. Now if you are using a serverscript then theres more problems. You have LocalPlayer on line 3, which can only work in a LocalScript. We need more information to help you here

1

Now if this is put into the correct scripts, and you just have lines 8-12 in a server script then the problem is that you are passing over 'player' from the event, but you have no specified player in the server script

6

Please don't downvote posts for having incorrect code - that's the entire point of the site

0

Why does this have a downvote?

0

@NinjoOnline Ty very much for answering it. And thanks for explaining.

2

Anyone looking at this in the future here is an article that explains Remote Functions and Events: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial