There is a TextButton inside a ScreenGui.
The TextButton is the one I am using MouseButton1Click.
--This is a script inside the 'TextButton'
local function mouseClicked(player)
game:GetService("ReplicatedStorage").ShopBuy:FireClient(player)
end
script.Parent.MouseButton1Click:Connect(mouseClicked)
--This is a LocalScript inside the 'ScreenGui' in StarterGui
local remote = game:GetService("ReplicatedStorage"):WaitForChild("ShopBuy")
remote.OnClientEvent:Connect(function()
script.Parent.Open.Value = true
end)
--This is a LocalScript inside the 'ScreenGui' in StarterGui. This Script will open the Gui with TweenPosition.
if script.Parent.Open.Value == true then
script.Parent.PromptPurchase:TweenPosition(UDim2.new(0.5,-225,0.5,-150),"Out","Quint",0.1,"true")
end
Note that 'Open' is a BoolValue in the Gui. It will just notify if the Gui should open.
Okay. There is a problem from now.
--Output :
FireClient: player argument must be a Player object
There was a error so I looked up on the Roblox Wiki but still the red output won't go away.
Can anybody tell me why doesn't this script(or localscript) doesn't work and can give a fix if necessary?
Thanks for your support.

4 comments
Only a click detector passes the player object as an arg because it works with FE.
All gui things should be managed on the client side. In your case there is no need for any remotes. The player should click a button and the gui should be shown. No server action is needed to show / hide a gui.
We need to see your server script to determine the issue with the fire client, the gui won't open since the if-then statement to open it is outside of the connected function
But If I do that on the client side, will it open it for all players?