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

FireClient: Player Argument Not Player Object?

Hello, I haven't continued my work cause of stupid bugs. I have made a script for an admin panel which can be activated with a card. btw its a FEI: Filtering Enabled Issue.

Script:

local event = game.ReplicatedStorage:WaitForChild("AdminEvent")
script.Parent.Touched:Connect(function(card)
	local parent = script.Parent.Parent.Parent.Admin
	if card.Name == "Admin Card" then
	    script.Parent.Parent.LED.BrickColor = BrickColor.new("Bright green")
		script.Parent.Beep:Play()
		wait(0.5)
		script.Parent.Parent.LED.BrickColor = BrickColor.new("Really black")
		script.Parent.Parent.Parent.PlayerName.Value = card.Parent.Parent.Parent.Name
		event:FireClient(player,card,parent) --The Problem
	end
end)

Local Script:

local event = game.ReplicatedStorage:WaitForChild("AdminEvent")
event.OnClientEvent:Connect(function(card, parent)
		parent.Enabled = true
end)

Edit Script or Explain solution :)

1 answer

✓ Accepted answer

When you do :FireClient(player), the player argument is the client you want to fire. You haven't specified what "player" means in the first script, therefore it is nil, and not a player.

As for the solution, you can get the player who touched and put him in the palyer argument.

3 comments

0

Like the character or local player?

0

You can find the character then get the player from character. This might help: https://scriptinghelpers.org/questions/32057/how-do-i-find-a-players-character-using-the-touched-event

0

thanks i got it :)

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