[SOLVED] Remote Event not firing to Client?

So, I want to communicate my Server-Sided script to my Client-Sided script. Simple, remote event.
Somehow, this did not work. I might have a simple error in my script, so please point it out.
Server-Sided Script:

local plrs = game.Players
local rem = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("Golden")
plrs.PlayerAdded:Connect(function(plr)

	local leaderstats = plr:WaitForChild("leaderstats")
	local char = plr.Character or plr.CharacterAdded:Wait()
	local deaths = leaderstats:WaitForChild("DeathAmount")
	local head = char:WaitForChild("Head")
	local humanoid = char:WaitForChild("Humanoid")
	deaths.Changed:Connect(function()

		if deaths.Value >= 50 then
			plr:LoadCharacter()	
			char = plr.Character or plr.CharacterAdded:Wait()		
			local billboardGui = Instance.new("BillboardGui",head)
			local textLabel = Instance.new("TextLabel",billboardGui)
			textLabel.BackgroundTransparency = 1
			billboardGui.Parent = char:FindFirstChild("Head")
			billboardGui.StudsOffsetWorldSpace = Vector3.new(0,3,0)
			billboardGui.Size = UDim2.new(0,200,0,50)
			textLabel.Parent = billboardGui
			textLabel.Font = Enum.Font.Legacy
			textLabel.TextColor = BrickColor.Yellow()
			textLabel.Text = "Golden"
			textLabel.Size = UDim2.new(0,200,0,50)
			textLabel.TextSize = 19
			rem:FireClient(plr.UserId)
		end

	end)

end)

Client-Sided Script:

local rem = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("Golden")

local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()

local char = plr.Character or plr.CharacterAdded:Wait()

local head = char.PrimaryPart

local chat = game:GetService("Chat")

rem.OnClientEvent:Connect(function()
	local setting = {
		UserSpecificSettings = {
			[plr.UserId] = {
				TextColor3 = Color3.fromRGB(255, 215, 0)
			}
		}
	}
	chat:SetBubbleChatSettings(setting)
	
end)

I noticed that you typed, “rem:FireClient(plr.UserId).” I don’t know if that is a necessary argument. However, when firing to a client, the first argument should be the player you are firing to. So it would be like this: “rem:FireClient(plr, --[[other arguments here]]).”

Still doesn’t work when I put plr in the arguments.

I tested your scripts in the Studio, and they are working fine after that little adjustment. I am unsure of what the issue is.


Any information from your Output window?

Not anything related to the script.

Nevermind, I found the error, I needed to reset my character.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.