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

RemoteEvent:FireClient() Problem.. What the heck am I doing wrong?

Asked by
Nymint 85
10 years ago
local EvStr=Game:GetService("ReplicatedStorage"):WaitForChild("Event_Data")
local CStr=Game:GetService("ReplicatedStorage"):WaitForChild("Clean_Data")
Game:GetService("Players").PlayerAdded:connect(function(plr) print(plr.Name.." Joined")

local LocalData=Instance.new("Model",plr) LocalData.Name="Deleted_Bricks"
local Stats=Instance.new("IntValue",plr) Stats.Name="leaderstats"
local Del=Instance.new("IntValue",Stats) Del.Name="Deletes" Del.Value=0
local Kicks=Instance.new("IntValue",Stats) Kicks.Name="VoteKicks" Kicks.Value=0
local Warns=Instance.new("IntValue",Stats) Warns.Name="Warnings" Warns.Value=0
local Vc=Instance.new("BoolValue",plr) Vc.Name="CleanVoted" Vc.Value=false
local InSpawn=Instance.new("BoolValue",plr) InSpawn.Name="InSpawn" InSpawn.Value=true
local Vk=Instance.new("BoolValue",plr) Vk.Name="VoteKicked" Vk.Value=false
local Con=Instance.new("Configuration",plr) Con.Name="VoteKickedPlayers" CStr:WaitForChild("Votes").Value=0
for i,v in ipairs(Game:GetService("Players"):GetPlayers()) do v:WaitForChild("CleanVoted").Value=false end
pj=plr.Name EvStr:WaitForChild("PlayerJoinedEvent"):FireClient(player,plr)
plr.CharacterAdded:connect(function(char) char:WaitForChild("Humanoid").Died:connect(function() InSpawn.Value=true print(plr.Name.." Died") end)end)end)
Game:GetService("Players").PlayerRemoving:connect(function(p) pl=p.Name print(pl.." Left")
EvStr:WaitForChild("PlayerLeftEvent"):FireClient(player,p) end)

Check the :FireEvent() lines, this error shows up in the Developer console:

:FireClient player argument must be a Player object

Help.. ):

0
What's "player" on the line 10? gskw 1046 — 10y
0
You mean the line 15? because there's nothing in the line 10, According to the wiki, a remote event has a first argument "Player object", I don't know how to use it but if I don't include it in the :FireClient() then the developer console says: "Unable to cast value to object." Nymint 85 — 10y

1 answer

Log in to vote
0
Answered by
Nymint 85
10 years ago

Nevermind, fixed, the solution to this is RemoteEvent:FireAllClients(Arguments).

Ad

Answer this question