Remote events not working

I’m creating a game and i’m not expert at scripting, i just know the basics.
It was going everything fine but my remote events just stopped working, i dont know the reason

Can you help me please?
Here’s the explanation:

The Remote Event is called “ButtonClicked” and is in ReplicatedStorage already

This code is in the Starter Player’s Script and fires the Server

local remoteEvent = game.ReplicatedStorage:WaitForChild("ButtonClicked")
local ClickDetector2 = game.Workspace.Button2.ClickDetector
ClickDetector2.MouseClick:Connect(function()
	remoteEvent:FireServer()
end)

This code is in the Server Script Service and receives the signal Server Side

local remoteEvent = game.ReplicatedStorage:WaitForChild("ButtonClicked")
remoteEvent.OnServerEvent:Connect(function()
	print("Hi")
end)

It’s a simple code that i was testing but it just doesn’t work…

3 Likes

I was testing your code and when i tested it all worked fine maybe you have spelled something wrong. (:

1 Like

Only " Infinite yield possible on ‘ReplicatedStorage:WaitForChild(“Status”)’ "

But it displays in yellow, i don’t think is the real problem

Hello, you might have misspelled something. Can u post a pic of ur explorer =]

1 Like

It looks to me like it’s not necessary here to use RemoteEvents.
Try putting this in a server-sided script in ServerScriptStorage

local ClickDetector2 = workspace.Button2.ClickDetector
ClickDetector2.MouseClick:Connect(function()
print("Hi")
end)

If you’re sure you want to use it like this, check to make sure you didn’t misspell anything.

1 Like

This worked for me, i think it fits what i need, thank you :slight_smile:

Thank you for the help guys :slightly_smiling_face:

1 Like