Remote Event is not being received on client side

Hi all, I’m creating a dialogue script that moves my body away and makes the camera face the NPC I’m talking to. (Right now I’m testing with an NPC named Hacker) To activate the dialogue after using a proximity prompt, I used a remote event fired to the client, but it isn’t being received with no errors at all.
Output:

  16:54:23.112  [REDACTED]
  16:54:43.416  Fired  -  Server - TalkScript:21

Script:

local prompt = script.Parent
local hacktalk = false
local badgeservice = game:GetService("BadgeService")
local hacktalkPlayerPos = game.Workspace.HackerBadgeThingy.Position
local hacktalkCameraPos = game.Workspace.HackerTalkCam.Position
local camFocus = game.Workspace.Hacker:WaitForChild("Head").Position

prompt.Triggered:Connect(function(plr)
	hacktalk = true
	local dialogue = {"Hey, what are you doing here?",
		"...",
		"...You shouldn't be up here.",
		"I think you're expecting the Hacker badge. Aren't you?",
		"You must be those type of players who use hacks just to get what they want.",
		"Or, you're using a tutorial to help you.",
		"You know what, I don't care. Take it, and leave me alone.",
		"But you've done something terribly wrong.",
		"I hope you understand that.",
		'game:GetService("BadgeService"):AwardBadge(' .. tostring(plr.UserId) .. ', 2124984212)'}
	game.ReplicatedStorage.Talk:FireClient(plr, dialogue, "Hacker", hacktalkPlayerPos, hacktalkCameraPos, camFocus)
	print("Fired")
end)
game.ReplicatedStorage.AwardBadgefromTalk.OnServerEvent:Connect(function(player, badgeID)
	if hacktalk == true then
		hacktalk = false
		local success, returned = pcall(function()
			return badgeservice:GetBadgeInfoAsync(2124984212)
		end)
		if success then
			local badgeEnabled = returned.IsEnabled
			if badgeEnabled then
				local success2, returned2 = pcall(function()
					return badgeservice:UserHasBadgeAsync(player.UserId, 2124984212)
				end)
				if success2 then
					if returned2 == false then
						badgeservice:AwardBadge(player.UserId, 2124984212)
					end
				end
			end
		end
		hacktalk = true
	end
end)

Local script:

local repstorage = game:GetService("ReplicatedStorage")
local text = script.Parent.Text
local speker = script.Parent.Speaker
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:Wait()
local currentCam = game.Workspace.CurrentCamera
local torso = char:WaitForChild("Torso")
repstorage:FindFirstChild("Talk").OnClientEvent:Connect(function(dialogue, speaker, bodyPos, camPos, camFocus)
	print("Received")
	torso.Position = bodyPos
	torso.Anchored = true
	currentCam.CameraType = Enum.CameraType.Scriptable
	currentCam.CFrame = CFrame.new(camPos)
	currentCam.Focus = CFrame.new(camFocus)
	script.Parent.Visible = true
	speker.Text = speaker
	for j, v in ipairs(dialogue) do
		local stringlength = string.len(v)
		for i = 1, stringlength do
			text.MaxVisibleGraphemes = i
			text.Text = v
			task.wait(0.05)
		end
		task.wait(3)
	end
	repstorage.AwardBadgefromTalk:FireServer(2124984212)
	currentCam.CameraType = Enum.CameraType.Custom
	torso.Anchored = false
	script.Parent.Visible = false
end)

For some strange reason it was received on the client before I added bodyPos, camPos, and camFocus.

with in the remote event remove the plr from the FireClient since its already interacting with the client and in the local script, add plr in the OnClientEvent and it will probaly work

Wait… so if there’s no plr parameter in FireClient how will the game know which client to fire the remote event? (I tried and it didn’t work)

if its fireallclients then u need the player parameters but since u firing it using FireClient it already knows ur firing it. If im sure

https://developer.roblox.com/en-us/api-reference/function/RemoteEvent/FireClient

I double checked FireClient parameters, plus if it’s sending to all clients (FireAllClients) it wouldn’t need a player parameter since it’s just going through every single player instead of finding an individual player.

ok may bad rip

Summary

This text will be hidden

1 Like

It’s okay, it seems quite difficult to solve though, it’s like the local script isn’t even running (I added print on first line in local script, didn’t print, I’ll check it out)
EDIT: The script runs, but after a few lines it mysteriously stops, the event never gets received

It started working, I think it was because I used .CharacterAdded:Wait() instead of just .Character

1 Like

glad u found u found the solution