Sorry for the weird title, if you want a quick TL:DR on this it is about:
18:36:38.974 - FireClient: player argument must be a Player object
I would really appreciate some help here
Okay so I have a brick:
"RemoveGui" and inside there there is a script
local brick = script.Parent
brickClosedEvent = game.ReplicatedStorage.Event.BrickClose
local debounce = false
brick.Touched:Connect(function(hit)
if not debounce then
debounce = true
print("activated")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
brickClosedEvent:FireClient(player)
print("WorkingClose")
wait(0.5)
debounce = false
end
end)
And I have another brick called "AddGui" which will show the gui, whereas RemoveGui will close it whcih goes
local brick = script.Parent
brickTouchedEvent = game.ReplicatedStorage.Event.BrickTouched
local debounce = false
brick.Touched:Connect(function(hit)
if not debounce then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
brickTouchedEvent:FireClient(player)
print("Working")
wait(0.5)
debounce = false
end
end)
And then in replicated storage I have a folder called "Event" and inside that two remote events which are called "BrickClose" and "BrickTouched"
And finally in StarterGui I have got a local script called "BrickGui" which has a Gui called "Gui" and a frame inside that called "Frame".
So the local script (BrickGui) goes:
local gui = script.Gui
local brickTouchedEvent = game.ReplicatedStorage.Event.BrickTouched
local brickCloseEvent = game.ReplicatedStorage.Event.BrickClose
brickTouchedEvent.OnClientEvent:Connect(function()
gui.Enabled = true
print("open")
end)
brickCloseEvent.OnClientEvent:Connect(function()
print("going to close")
gui.Enabled = false
end)
So what I am aiming for is that the two remote events will fire and the local gui will pick them up and do so accordingly.
However
What my problem is that when I touch AddGui it says, "18:36:38.974 - FireClient: player argument must be a Player object"
I have read other articles on this but I can't really grasp what I should do.
I would really appreciate some help here, Thanks

4 comments
Hi! Thanks for the quick reply, and sorry for my slow one, it still seems to not work but however this time it does not print anything in the output at all?
Hm.. so it doesn't print 'Working' either?
with your code no, but when i reverted it back to the original it does
it might be the debounce then.