Why isn't my remote event firing?

Can i please see the team changer GUI script?

i got it to print, but it’s not printing the right team for some reason. Here’s the new script.
image
and here’s the print
image

this only prints when i click the purple icon, which is management. how would I go about printing the team I got changed into, and not the team I was on previously?

i’ve tried adding a wait to the script, yet it makes it just not work anymore

Could we see a full version of what Script you have on the server and client regarding this issue? It’s a bit confusing having the Scripts being modifying bit by bit.

Alrighty!

Serverscript

--Custom Leaderboard Script. Made by Leaderboard+ plugin (by Infinite_Visions).
--Find the plugin Documentation here: https://devforum.roblox.com/t/leaderboard-create-custom-leaderboards-in-studio/1338477

local Settings = script.Parent.Settings
local Path = nil
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local managementEvent = replicatedStorage.ManagementTeam

--Handle Admins. If You Have no admins, ignore this.
local Admins = {
	"Infinite_Visions",
	"Example_Name_Here"
}

--Get Creator Id
local ownerId = nil
if game.CreatorType == Enum.CreatorType.Group then
	local PlaceInfo = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId)
	ownerId = game:GetService("GroupService"):GetGroupInfoAsync(PlaceInfo.Creator.CreatorTargetId).Owner.Id
else
	ownerId = game.CreatorId
end

--Setup Players Already In-Game
for i, player in pairs(game.Players:GetChildren()) do
	--Add a slot to the leaderboard
	local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
	NewSlot.Name = player.Name
	
	--Handle Names
	local NameText = nil
	
	if Settings.DisplayNames.Value == true then
		NameText = player.DisplayName
	else
		NameText = player.Name
	end
	
	if Settings.UpperCase.Value == true then
		NewSlot.PlrName.Text = string.upper(NameText)
	else
		NewSlot.PlrName.Text = NameText
	end
	
	--Handle Icons
	if player.UserId == ownerId and Settings.ShowOwner.Value == true then
		NewSlot.Owner.Visible = true
	else
		if Settings.ShowAdmin.Value == true then
			for i = 1, #Admins do
				if player.Name == Admins[i] then
					NewSlot.Admin.Visible = true
				end
			end
		elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then	
			NewSlot.GamepassSymbol.Visible = true
		elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
			NewSlot.Premium.Visible = true
		end
	end
	
	--If CustomData, Handle DataChanges
	if Settings.CustomData.Value == true then
		Path = script.Parent.Settings.CustomData		
		Path.Changed:Connect(function()
			NewSlot.Currency1.Text = Path.Value
		end)
	end
	NewSlot.Visible = true
	--The Path to the Values you want displayed, if any.
	NewSlot.Parent = script.Parent.LeaderboardFrame.HoldingFrame
end

game.Players.PlayerAdded:Connect(function(player)
	--Add a slot to the leaderboard
	local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
	NewSlot.Name = player.Name
	
	--Handle Names
	local NameText = nil
	
	if Settings.DisplayNames.Value == true then
		NameText = player.DisplayName
	else
		NameText = player.Name
	end
	
	if Settings.UpperCase.Value == true then
		NewSlot.PlrName.Text = string.upper(NameText)
	else
		NewSlot.PlrName.Text = NameText
	end
	
	--Handle Icons
	if player.UserId == ownerId and Settings.ShowOwner.Value == true then
		NewSlot.Owner.Visible = true
	else
		if Settings.ShowAdmin.Value == true then
			for i = 1, #Admins do
				if player.Name == Admins[i] then
					NewSlot.Admin.Visible = true
				end
			end
		elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then	
			NewSlot.GamepassSymbol.Visible = true
		elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
			NewSlot.Premium.Visible = true
		end
	end
	
	--If CustomData, Handle DataChanges
	if Settings.CustomData.Value == true then
		Path = script.Parent.Settings.CustomData		
		Path.Changed:Connect(function()
			NewSlot.Currency1.Text = Path.Value
		end)
	end
	NewSlot.Visible = true
	
	local function test(arg1, arg2)
		print("testing", arg1, arg2)
	end
		end)

managementEvent.OnServerEvent:Connect(function(player, teststring, teamCheck)
	if teamCheck == Teams.Management then
		local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
		NewSlot.Name = player.Name
		NewSlot:WaitForChild("TeamImage").Visible = true
	end
end)

localscript

--local Close = script.Parent.LeaderboardFrame.Close

--Disable Roblox's leaderboard.
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

local plr = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local ManagementEvent = replicatedStorage.ManagementTeam

local teamCheck = plr.Team

plr:GetPropertyChangedSignal("Team"):Connect(function()
	if plr.Team == Teams.Management then
		teamCheck = Teams.Management
		ManagementEvent:FireServer("test", teamCheck)
	end
end)

So does the RemoteEvent fire accordingly when the Player selects the Management team? I don’t see any print statements that attempts to print the Player’s team on the Scripts you provided.

Yes, it now fires when a player selects the management team. Before, it used to print “Choosing” since this is the neutral team. So, to combat against this, made " if plr.Team == Teams.Management then teamCheck = Management, which fixed the issue of the remote event firing the wrong team, but now I have an entirely separate bug to figure out

Local Script

--local Close = script.Parent.LeaderboardFrame.Close

--Disable Roblox's leaderboard.
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

local plr = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local ManagementEvent = replicatedStorage.ManagementTeam

local teamCheck = plr.Team

plr:GetPropertyChangedSignal("Team"):Connect(function()
	if plr.Team == Teams.Management then
		teamCheck = Teams.Management.Name
		ManagementEvent:FireServer("test", teamCheck)
	end
end)```

```lua
--Custom Leaderboard Script. Made by Leaderboard+ plugin (by Infinite_Visions).
--Find the plugin Documentation here: https://devforum.roblox.com/t/leaderboard-create-custom-leaderboards-in-studio/1338477

local Settings = script.Parent.Settings
local Path = nil
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local managementEvent = replicatedStorage.ManagementTeam

--Handle Admins. If You Have no admins, ignore this.
local Admins = {
	"Infinite_Visions",
	"Example_Name_Here"
}

--Get Creator Id
local ownerId = nil
if game.CreatorType == Enum.CreatorType.Group then
	local PlaceInfo = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId)
	ownerId = game:GetService("GroupService"):GetGroupInfoAsync(PlaceInfo.Creator.CreatorTargetId).Owner.Id
else
	ownerId = game.CreatorId
end

--Setup Players Already In-Game
for i, player in pairs(game.Players:GetChildren()) do
	--Add a slot to the leaderboard
	local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
	NewSlot.Name = player.Name
	
	--Handle Names
	local NameText = nil
	
	if Settings.DisplayNames.Value == true then
		NameText = player.DisplayName
	else
		NameText = player.Name
	end
	
	if Settings.UpperCase.Value == true then
		NewSlot.PlrName.Text = string.upper(NameText)
	else
		NewSlot.PlrName.Text = NameText
	end
	
	--Handle Icons
	if player.UserId == ownerId and Settings.ShowOwner.Value == true then
		NewSlot.Owner.Visible = true
	else
		if Settings.ShowAdmin.Value == true then
			for i = 1, #Admins do
				if player.Name == Admins[i] then
					NewSlot.Admin.Visible = true
				end
			end
		elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then	
			NewSlot.GamepassSymbol.Visible = true
		elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
			NewSlot.Premium.Visible = true
		end
	end
	
	--If CustomData, Handle DataChanges
	if Settings.CustomData.Value == true then
		Path = script.Parent.Settings.CustomData		
		Path.Changed:Connect(function()
			NewSlot.Currency1.Text = Path.Value
		end)
	end
	NewSlot.Visible = true
	--The Path to the Values you want displayed, if any.
	NewSlot.Parent = script.Parent.LeaderboardFrame.HoldingFrame
end

ServerScript

game.Players.PlayerAdded:Connect(function(player)
	--Add a slot to the leaderboard
	local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
	NewSlot.Name = player.Name
	
	--Handle Names
	local NameText = nil
	
	if Settings.DisplayNames.Value == true then
		NameText = player.DisplayName
	else
		NameText = player.Name
	end
	
	if Settings.UpperCase.Value == true then
		NewSlot.PlrName.Text = string.upper(NameText)
	else
		NewSlot.PlrName.Text = NameText
	end
	
	--Handle Icons
	if player.UserId == ownerId and Settings.ShowOwner.Value == true then
		NewSlot.Owner.Visible = true
	else
		if Settings.ShowAdmin.Value == true then
			for i = 1, #Admins do
				if player.Name == Admins[i] then
					NewSlot.Admin.Visible = true
				end
			end
		elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then	
			NewSlot.GamepassSymbol.Visible = true
		elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
			NewSlot.Premium.Visible = true
		end
	end
	
	--If CustomData, Handle DataChanges
	if Settings.CustomData.Value == true then
		Path = script.Parent.Settings.CustomData		
		Path.Changed:Connect(function()
			NewSlot.Currency1.Text = Path.Value
		end)
	end
	NewSlot.Visible = true
	
	local function test(arg1, arg2)
		print("testing", arg1, arg2)
	end
		end)

managementEvent.OnServerEvent:Connect(function(player, teststring, teamCheck)
	if teamCheck == Teams.Management.Name then
		local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
		NewSlot.Name = player.Name
		NewSlot:WaitForChild("TeamImage").Visible = true
	end
end)```

Maybe if you fire the name of the Team rather than the team object itself?

OP has already found a solution to comparing the Team instance, anyways.

1 Like

Ahhh okay, @bIIocky what’s the new bug you’re facing?

The TeamImage imagelabel is not changing to visible, even after this line of code is executed

managementEvent.OnServerEvent:Connect(function(player, teststring, teamCheck)
	if teamCheck == Teams.Management then
		print(teamCheck)
		local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
		NewSlot.Name = player.Name
		NewSlot:WaitForChild("TeamImage").Visible = true

What if you make the image visible before you change the name?

managementEvent.OnServerEvent:Connect(function(player, teststring, teamCheck)
	if teamCheck == Teams.Management then
		print(teamCheck)
		local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
	    NewSlot:WaitForChild("TeamImage").Visible = true
        NewSlot.Name = player.Name

still not visible, unfortunately

This is dandy and all, but for the sake of being organised, would you mind creating a new topic for this issue instead? Help mark the reply which helped you solve the issue as the Solution of the topic!

The new thread may be found here!

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