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.