Help with FireClient() with specified player

I have a seat that when a players leaves the seat it should fire an event. but im getting this error: “player argument must be a Player object”
Here is the script:

Seat.ChildRemoved:Connect(function(child)
	if child.Name == "SeatWeld" then
		if Active == true then
			Player = Players:GetPlayerFromCharacter(Seat.Occupant.Parent)
			Active = false
			pcall(function() NewGui:Destroy() end)
			Player = nil
			NewGui = nil
			game.ReplicatedStorage.ComputerEvents.RemoveSit:FireClient(Player)
		end
	end
end)

Any help?

You’re setting the player variable to nil here, probably why it’s doing that

1 Like

Oooh I am so bad a scripting… Thank you!

1 Like

Fire the remote before you set the variable to nil like said

1 Like

Anytime! If you hae anymore issues don’t be afraid to make another post!

1 Like

Yes I did that, i put a very tiny wai there for no more errors: wait(0.01)