Remote Event not Firing

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I am trying to do :FireServer() from a local script to pass some info the server.

  1. What is the issue?
    However, the event is not firing.

  2. What solutions have you tried so far?

I tried using print statements to debug the error. Everything in client side works. The server side print doesn’t work and there are no errors in the console

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Here is the Local Script:

local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local db = false
local event = game.ReplicatedStorage:WaitForChild("TeamUp")




script.Parent.MouseButton1Click:Connect(function()
	
	if db == false then
		db = true
		local inviter = plr.Name
		local receiver = script.Parent.Text
		print("Sent")
		
		local val = plr.PlrConfig:WaitForChild("CurrentParty")
		event:FireServer(receiver)
		print(inviter.." invited "..receiver)
		
		script.Parent.BackgroundColor3 = Color3.fromRGB(0,255,0)
		print('Color Changed')
		wait(2)
		db = false
		script.Parent.BackgroundColor3 = Color3.fromRGB(52, 116, 255)
		print("Color Changed")
		
	end
end)

Here is the server script:

local event = game.ReplicatedStorage:WaitForChild("TeamUp")

event.OnServerEvent:Connect(function(receiver)
	print("Done Invited")
end)

Thanks :slight_smile:

Where is your ServerScript located? If you put a print at line 1 of the Script, does it appear in the output?

1 Like

My server script is in the ServerScriptService and it doesnt appear in the output

1 Like

As he said try placing a print statement in the First line of the script & also one on the OnServerEvent.

Ok, I will try it. [30charrrrr]

It does print at the beginning of the script. It doesnt print inside OnServerEvent

You fire Server is just after a WaitForChild, is your script working after that point? Or that might be the case its not firing the event.

Yes, everything after the FireServer is printing

One last wild guess that I can do is, can you change the variable name from event to something else like Remote

Are you also sure that the ServerScript has access to the RemoteEvent? If you put a print after the WaitForChild in the Script, does it appear? You would normally be getting a warning that the object was never found, but I’m just making sure.

There is no infinite yield warning and yes it has access to the Remote Event. Yes, I printed after the WaitForChild() and it printed it.

local event = game.ReplicatedStorage:WaitForChild("Events").TeamUp

event.OnServerEvent:Connect(function(player, receiver)
	print("Done Invited")
end)

This is what the server script should be.

It is true that a player argument gets passed as well. Thanks for pointing this out!

Unfortunately, this still shouldn’t solve the problem though.

Could you make sure its a Remote event indeed?

I tried it and it still didn’t work

Yes, it is a RemoteEvent and if it wasn’t wouldn’t it error?

Hm yeah, because I just tried a similar script to yours and it was working without any issues.

This is a really strange problem. Could you send us a project file containing the issue, and I could check it out when later when I get a chance?

You could also DM it to me privately if you are not comfortable sharing it publically.

Alright I tried using your script, it works for me. So at this point I’m not sure what’s going wrong.
image
Have you put the player variable in the server script which I mentioned?

I’ll just send it here. It’s fine