Getting this error from a script im working on: FireClient: player argument must be a Player object.
Anyone know whats wrong?
--script local remotes = game:GetService("ReplicatedStorage"):WaitForChild("IRemotes") local br = remotes:WaitForChild("BroadcastRemote") local player = game.Players.LocalPlayer script.Parent.Touched:Connect(function() print("TouchedBorder") br:FireClient(player) end)
--localscript local remotes = game:GetService("ReplicatedStorage"):WaitForChild("IRemotes") local br = remotes:WaitForChild("BroadcastRemote") br.OnClientEvent:connect(function() script.Parent.Visible = true wait(3) script.Parent.Visible = false end)
Why are you firing client when it seems you're using a LocalScript?
If it's a server script, then you need to define the player using GetPlayerFromCharacter().
Remove your player variable and edit your touched function to this.
script.Parent.Touched:Connect(function(otherPart) -- On touched, define part local player = game:GetService('Players'):GetPlayerFromCharacter(otherPart.Parent) -- find player if player then -- if player found br:FireClient(player) end end)
You need to define which player inside the parenthesis of the FireClient function