RemoteEvent not sending data

Hi, I want to transfer the variable “user_name”, but when I print it in the other script, the printing “nil”

Script:

    RemoteEvent.OnServerEvent:Connect(function(player,Test)
    local httpService = game:GetService("HttpService")
	local url = "https://users.roproxy.com/v1/users"
	local data = httpService:GetAsync(url .. "/" ..Test) 
	data = httpService:JSONDecode(data)
	print(data.name)
	local user_name = data.name
	RemoteEvent2:FireClient(player, user_name)
end)

LocalScript:

RemoteEvent2.OnClientEvent:Connect(function(player, user_name)
	task.wait(3)
	local yes_ban_user_gui = game.Players.LocalPlayer.PlayerGui.yes_ban_user
	yes_ban_user_gui.Enabled = true
	print(user_name) -- printing ''nil''
end)

.OnClientEvent doesnt have an player argument, That line should be this:

RemoteEvent2.OnClientEvent:Connect(function(user_name)
1 Like

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