Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

RemoteEvent On Server Not Responding?

The client is firing a remote event and the server is not doing anything about it. It doesn't print 'fired'.

Server

remote.OnServerEvent:Connect(function(plr,key,strings)
	print('fired')
	if key == 'key123' then
		local gui = script:FindFirstChildOfClass("ScreenGui"):Clone()
		gui.Parent = plr.PlayerGui
		gui.Enabled = true
	elseif key == 'key321' then
		Loadstring(strings) -- Using Module so its suppose to be a capital L
	end
end)

Client

local key = 'key123'
for i, v in pairs(game.Workspace:GetDescendants()) do
	if v.ClassName == 'RemoteEvent' then 
	v:FireServer(key)
	print(v.Name)
	end
	 end

1 answer

✓ Accepted answer

I actually had an error similar to this today. First, I don't believe you're using the correct loop for what you're wanting to do. Consider the following.

local key = 'key123'
for _,i in pairs(game.Workspace:GetDescendants()) do
	if i.ClassName == 'RemoteEvent' then 
		i:FireServer(key)
		print(i.Name)
	end
end

Furthermore, be sure that you don't have any looping functions before your event firing. In my situation, I had a while true do loop that stopped my event dead. Make sure that an event such as this is given priority placement in your script, that way it isn't interrupted.

If this helped at all, consider accepting this answer. If not, comment below and I'll be sure to help you further.

1 comment

0

Not sure what you did differently from my code besides change the variable names. Nothing different happens.

This discussion is preserved as it was. New answers, comments, and votes are closed.