Connect is not a valid member of RBXScriptSignal | (Roblox Leaderboard)

Code -

local template = script.Template
local Players = game:GetService("Players")
local playere = game.Players.LocalPlayer
local playerList = script

function clearlist()
	for _m, item in pairs(playerList:GetChildren()) do
		if item:IsA("TextLabel") then 
			item.Destroy()
		end
		end
	end

for _, team in ipairs(Teams:GetTeams()) do
	local frame = template:Clone()
	frame.Name = team.Name
	frame.LayoutOrder = #playerList:GetChildren()
end

function FillList()
	for _, player in pairs(Players:GetChildren()) do
		if not playerList:FindFirstChild(player.Name) then 
			local frame = template:Clone()
			frame.Name = player.Name
			frame.player.Text = player.Name
			frame.Parent = playerList
			
			frame.LayoutOrder = playerList[player.Team.Name].LayoutOrder + 1
			for _, object in pairs(playerList:GetChildren()) do
				if object:IsA("Frame") and object.LayoutOrder >= frame.LayoutOrder and object ~= frame then 
					object.LayoutOrder = object.LayoutOrder +1
				end
			end
			player:GetPropertyChangedSignal("TeamColor"):Connnect(function()
				frame.LayoutOrder = playerList[player.Team.Name].LayoutOrder + 1
			end)
		end
	end
end
FillList()

game.Players.PlayerAdded:Connect(FillList)
game.Players.PlayerRemoving:Connect(FillList)

Error - Connect is not a valid member of RBXScriptSignal

Error - Connect is not a valid member of RBXScriptSignal

What line is the error on?

Also when logging your error, do it like this:

Code:

print(B)

Full Error:

 18:41:46.760  nil  -  Server - Script:1

My print statement won’t work, I’m not sure why though.


Please edit your main topic to support the statement above.

Bottom two errors fully error. Rest of it does not

Alright, first error is that

The 3 backticks shouldn’t be there.

In addition to that could you please edit your main post to use this method, otherwise I can’t exactly tell what’s going on.

3 backticks are my shocking formatting of messages.

Full error -

10:19:16 – Connect is not a valid member of RBXScriptSignal - Server - Script:43

Albright, great, this means we have an error on line 43.

Okay this script is quite messy, could you attempt to re-code it?

Your code has game.Players.LocalPlayer, which can only be used in a localscript, your script is meant to be in the server script.

Connect is not a valid member of RBXScriptSignal

This script manages to work:

local function fillList()
	print("Hi!")
end


game.Players.PlayerAdded:Connect(fillList)

Consider editing this and the other function to be local function FillList()

Something like this would work:

function clearlist()
	print("ClearList")
end



function FillList()
	print("FillList")
end
FillList()

game.Players.PlayerAdded:Connect(FillList)
game.Players.PlayerRemoving:Connect(FillList)



If you need any help with coding a new script, this might help:

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