RemoteEvent is not working

What is the issue? Remote Event is not working.

I put local script in playergui Textbutton, and I put script in ServerScriptService

local script:

local Button = script.Parent

Button.MouseButton1Click:Connect(function()
	
	local RemoteEvent = game.ReplicatedStorage.RemoteEvents.SendRequest

	local TargetName = script.Parent.Name
	local PlayerName = game.Players.LocalPlayer.Name
	
	RemoteEvent:FireServer(TargetName,PlayerName)
	
	print("Step1")

end)

Script:

local RemoteEvent = game.ReplicatedStorage.RemoteEvents.SendRequest

RemoteEvent.OnServerEvent:Connect(function(a,Target,From)
	
	
	local TargetPlayer = game.Players:FindFirstChild("Target")
	
	game.ReplicatedStorage.RemoteEvents.SendRequest:FireClient(TargetPlayer,From)
	
	print("Step2")
end)

“Step1” was printed but “Step2” Wasnt printed.

1 Like

on this line youre trying to find a player with the name Target, remove the quotation marks from FindFirstChild if you want to find the player with the name as the Target variable

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