#FireClient Problem

1 messages · Page 1 of 1 (latest)

rigid adder
#

I'm not used to using this function and I have no idea how to fix this error.

I'm using a serverscript under a TextButton that when you click it, it fires to the client to play a sound but for some reason it doesn't work

Server Script:

local RS = game:GetService("ReplicatedStorage")
local Events = RS:WaitForChild("Events")
local ClickEvent = Events:WaitForChild("ClickEvent")

local Button = script.Parent

Button.MouseButton1Click:Connect(function()
    
    ClickEvent:FireClient()
    
end)

Local Script:

local RS = game:GetService("ReplicatedStorage")
local Events = RS:WaitForChild("Events")
local ClickEvent = Events:WaitForChild("ClickEvent")

ClickEvent.OnClientEvent:Connect(function(plr)
    
    print("work")
    
end)
north holly
#

gui handling works on local scripts

#

so the first one should be a local script

rigid adder
#

It isin't in gui

#

It's inside of a surface gui, not a player one

north holly
#

i think its kinda the same

rigid adder
#

I tried

north holly
#

damn

rigid adder
#

The MouseButton event doesn't connect

#

It's not the clicking that's the problem, it's the FireClient

#

😔