Remote Event Not Being Picked Up By The Server

Hello! So I have a problem, and when I fire a remote event the server isn’t picking it up.

  1. What do you want to achieve? When the GUI button is clicked, BarnDoors should hide

  2. What is the issue? The Server isn’t picking up the remote event. It worked before, but since my Roblox Studio Updated about 1 week ago it broke.

  3. What solutions have you tried so far? I have tried using prints and the server still won’t pick it up! (I have read about remote events on the Wiki, and it still doesn’t work)

The Clicking of the GUI button, is just for testing purposes.

(Here is the local script for my GUIs, which fires the RemoteEvent)

local Test = script.Parent.Test

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local DisableObject = ReplicatedStorage:FindFirstChild("DisableObject")

script.Parent:WaitForChild("Test").MouseButton1Click:Connect(function()
 	DisableObject:FireServer()
	print("Fired Server!")
end)

(This is in a script in ServerScriptService, (I have not put the barnDoor things in yet! I am just trying to get it to pick it up!)

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local barnDoor = game.Workspace.Maps.FarmMap.BarnDoor
local barnDoor2 = game.Workspace.Maps.FarmMap.BarnDoor2
local DisableObject = game.ReplicatedStorage:FindFirstChild("DisableObject")

DisableObject.OnServerEvent:Connect(function()
	print("Remote Event Picked up")
end)

All The output says is, when I click the button is “Fired Server!” There isn’t any “Remote Event Picked up” in the output. And there is nothing in the Dev Console! about it. And yes the name of the remote event is the Exact same as the one in replicated storage.

1 Like

In the variable for the DisableObject instead of :FindFirstChild() use :WaitForChild() and see if that makes any difference?

For what part? In Server Script or the local script?

Both of them (30,hatdfstagers)

Ok! I will try that out, and I will get back to you as soon as possible!

1 Like

On the local script, you’re calling “Test” a string instead of an object. Try changing your script to:
——-
local Test = script.Parent.Test

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)

local DisableObject = ReplicatedStorage:FindFirstChild(“DisableObject”)

script.Parent:WaitForChild(Test).MouseButton1Click:Connect(function()
DisableObject:FireServer()
print(“Fired Server!”)
end)
——-
(sorry I’m in mobile so Idk how to do the actual block of code)
You said WaitForChild(“Test”) when it should be just (Test)

1 Like

I Tried, but the sever still doesn’t pickup the remote event. In the output it does say “Fired Server!” But there are no “Remote Event Picked up”
(The ServerScript)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DisableObject = game.ReplicatedStorage:WaitForChild("DisableObject")

DisableObject.OnServerEvent:Connect(function()
	print("Remote Event Picked up")
end)

(Local Script in the GUI)

local Test = script.Parent.Test

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local DisableObject = ReplicatedStorage:WaitForChild("DisableObject")

script.Parent:WaitForChild("Test").MouseButton1Click:Connect(function()
 	DisableObject:FireServer()
	print("Fired Server!")
end)

When I change it from “Test” to test, nothing gets printed in the output.

Could you try adding a print in your server script after the event binding, just to see if the script is active and the event binding was executed?
e.g:

DisableObject.OnServerEvent:Connect(function()
    print("Remote Event Picked up")
end)

print("script running, event binded")

No, it just printed “Fired Server!”

If that latter print statement didn’t fire, at least one of three problems could be affecting you:

  • the server script is disabled: just uncheck the .Disabled property.

  • the server script is not a descendant of the right service: they can only be active in Workspace, ServerScriptService, or ReplicatedScriptService (if you happened to add it to your explorer).

  • maybe your server script is not a class of Script: if not, you should create a new script and transfer the source code there.

You can read more about Scripts on the dev hub if you need!

Check the remote or scripts properties Archivable, does it have a check mark, if it doesnt, give it a check mark

I have tried all of those, I even deleted the remote Event and renamed it. I copied and paste the name to make sure it was right. The sever still isn’t picking it up.

1 Like

Assuming you do not have any errors, and have implemented what others have said, run your game
in Studio and look in ReplicatedStorage in the Explorer and see if you have more than one
"DisableObject" RemoteEvent there, as Object names do not need to be unique.

I should also note that your OnServerEvent handler should have a player argument, so you can
tell which player it came from.

1 Like

There aren’t double of “DisableObject” Remote Event. I added the player argument. And the sever still won’t pick it up.

Please post your most up-to-date code, and tell us where each script is located.

This is my script, in ServerScriptService. (I renamed DisableObject to HideObject, to see if it fixes) ignore the barnDoor Variables.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local barnDoor = game.Workspace.Maps.FarmMap.BarnDoor   -- The Remote Event Fires This
local barnDoor2 = game.Workspace.Maps.FarmMap.BarnDoor2 -- The Remote Event Fires This
local HideObject = game.ReplicatedStorage:WaitForChild("HideObject")

HideObject.OnServerEvent:Connect(function(player)

print("Fired The Server!")

end)

print("script running, event binded")

This is my local script, in a screenGui. (Which has all my UI in)

local Test = script.Parent.Test
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HideObject = ReplicatedStorage:WaitForChild("HideObject")

script.Parent:WaitForChild("Test").MouseButton1Click:Connect(function()
 	HideObject:FireServer()
	print("Fired Server!")
end)

Are those the complete scripts or is there more above and below?
It looks fine to me–You mention that you are getting the Fired Server–I’ll assume it doesn’t
have an “x200” or whatever number beside it in the output.
A last thing to try: At the end of the Script, as a test, add:

repeat  wait(1)  until false

Edit:
One last question: Are you creating the RemoteEvent programmatically or did you just add it
it in the Studio Explorer?
Edit2: Typo

The RemoteEvent is already in the game, I am not creating it through scripts. I tried tha, and the sever still isn’t picking it up. Only for the local script, there are some stuff above it.

Are you using Home->Play in Studio to start the game?
Did you check F9->Scripts or ScriptPerformance to see if your Script is still running (using that wait.)
Did you carefully check the Output for errors?