Hello!
I want to fire an event if the player used a key card upon being touched. The "real" variable searches if it is a key card or not. Everything works fine except for the fire event which prints an error "FireClient: player argument must be a Player object" I tried for 30 minutes to fix this up but no idea came, if anyone can help me? Thank you!
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local real = hit:FindFirstChild("Real")
if real then
game.ReplicatedStorage.KeyCardDestroy:FireClient(player) -- Error
end
end)

1 comment
Thank you, thank you!!! It was because I needed two parents since the tool was made of two parts, thank you so much! Have a nice day!