RemoteEvent ignoring everything

I have 2 scripts

LocalScript:

CharacterSelection.OnClientEvent:Connect(function(instr, data)
	print('zamn', instr)
	print(' I NEED MENTAL HELP')
	if instr == "fix camera subject" then
		workspace.CurrentCamera.CameraSubject = data[1]
		print('O RLLY?', data[1].Name)
	end
end)

and a server script

CharacterSelection.OnServerEvent:Connect(function(plr,username,yes, data)
	if yes == "selected char" then
		print('ok')
		local char = data[1]
		local button_name = data[2].Name
		print(button_name)
		
		local new_char = char:Clone()
		new_char:SetPrimaryPartCFrame(plr.Character.PrimaryPart.CFrame)
		new_char.Parent = workspace
		new_char.Name = plr.Name
		
		plr.Character = new_char
		plr.PlayerGui.UI.SelectCharacterUI.Enabled = false
		
		CharacterSelection:FireClient(plr, "fix camera subject", {plr.Character.Head})
		print('whaterwhat bro what')
		
		for _,v in ipairs(game.Players:GetPlayers()) do
			local occupied = Instance.new('BoolValue', v.PlayerGui.UI.SelectCharacterUI.CharacterSelection:FindFirstChild(button_name))
			occupied.Value = true
			occupied.Name = "Selected"

			v.PlayerGui.UI.SelectCharacterUI.CharacterSelection:FindFirstChild(button_name).status.TextColor3 = Color3.new(1,0,0)
			v.PlayerGui.UI.SelectCharacterUI.CharacterSelection:FindFirstChild(button_name).status.Text = username

			print(char.Name, button_name)
		end
	end
end)
		

The CharacterSelection event is completely ignored by the local script, it doesnt print anything at all.
Is there a solution??

First of all, are you okay?

Secondly, have you tried firing without the table? Some things don’t replicate properly. I don’t believe this is one of those cases, but it doesn’t hurt validating.

Try putting a print on the line after end) in the local script, tell me if it prints.

2 Likes

U used OnServerEvent ,OnClientEvent in both scripts

Thats why not firing, Fire Server from another script

So you need Fire Event from another script

Are you calling RemoteEvent:FireServer() before or after setting up the RemoteEvent.OnClientEvent event listener? Because if before, the code on the client hasn’t registered the event listener yet.
If after, we need to see more of the code inside the LocalScript.

1 Like