** In a localscript in a gui in playergui **
local ReplicatedStorage = game:GetService("ReplicatedStorage") local AdvertiseEvent = ReplicatedStorage:WaitForChild("AdvertiseEvent") AdvertiseEvent.OnClientEvent:connect(function() print(player) script.Parent:TweenPosition(UDim2.new(0.4,0,0.35,0),'InOut','Quad',1,false) end)
** in a script inside of a brick in workspace **
local ReplicatedStorage = game:GetService("ReplicatedStorage") local AdvertiseEvent = ReplicatedStorage:WaitForChild("AdvertiseEvent") local Click = script.Parent:WaitForChild("Click") Click.MouseClick:connect(function() AdvertiseEvent:FireClient() end)
17:37:08.274 - Argument 1 missing or nil 17:37:08.277 - Script 'Workspace.Advertise.AdvertiseBrick.Script', Line 14
Your first argument needs to be the Player you're sending the event to. Otherwise, you can use FireAllClients
ClickDetectors, dialog chats, and a few other objects are initiated by the client, and so when dealing with FilteringEnabled, you have to fire from the client in a LocalScript, not a regular script in a brick on the server.