What do you want to achieve?
So I know ClickDetector is working in server-side script. Same as BillBoardGui.
What is the issue?
I want to make that BillboardGui can be seen to player only who click on part which have BillBoardGui
What solutions have you tried so far?
Make server script which fire client to enable Billboard. Its not working
ServerScript
local click = script.Parent.ClickDetector
local RemoteEvent = script.Parent.RemoteEvent
local BillBoard = script.Parent.BillboardGui
click.MouseClick:Connect(function()
RemoteEvent:FireClient(BillBoard)
end)
LocalScript
local RemoteEvent = script.Parent.RemoteEvent
local playersUI = game.Players.LocalPlayer.PlayerGui
RemoteEvent.OnClientEvent:Connect(function(BillBoard)
BillBoard.Enabled = not BillBoard.Enabled
BillBoard.Parent = playersUI
end)
And when i tested output yield error
FireClient: player argument must be a Player object
What I need to do?
It seems like you’re trying to enable a “BillboardGui” locally for a specific player who clicks on a part. You’ve set up a “ClickDetector” and a “RemoteEvent” to fire a client script, but you’re getting an error when trying to use “FireClient”
The error message “player argument must be a Player object” suggests that you need to specify which player to fire the client event to. In your server script, you can modify the FireClient line to include the player who triggered the click event:
click.MouseClick:Connect(function(player)
RemoteEvent:FireClient(player, BillBoard)
end)
-- By passing the player object as the first argument to FireClient, you're telling the server to send the event to that specific player's client.
-- Give this a try and see if it resolves the issue!
Find this in Reddit. And i think he is right and not. Ok we need to make BillBoardGui parent to playerGui. But we can’t get PlayerGui in server script. I guess in this way i need to fire server with playerGui.