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

FireClient: Player Argument Not Player Object?

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

0
Like the character or local player? dizzyjamison08 30 — 6y
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 radusavin366 617 — 6y
0
thanks i got it :) dizzyjamison08 30 — 6y
Ad

Answer this question