Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
4

How do I fix this RemoteEvent script? I just started to learn how to use RemoteEvents. [Answered] [closed]

Asked by 7 years ago
Edited 7 years ago

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.

0
is this all a local script? User#5423 17 — 7y
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 NinjoOnline 1146 — 7y
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 NinjoOnline 1146 — 7y
6
Please don't downvote posts for having incorrect code - that's the entire point of the site shayner32 478 — 7y
View all comments (3 more)
0
Why does this have a downvote? DepressionSensei 315 — 7y
0
@NinjoOnline Ty very much for answering it. And thanks for explaining. krisxxxz 45 — 7y
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 shadownetwork 233 — 7y

Locked by Goulstem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?