Team Creator GUI Not Working

  1. Hello, I am trying to make a Team Creator GUI that creates Teams using inputs of the Team Name and Team Color in BrickColor.

  2. I don’t know if its the whole script but this error keeps coming up: The current identity (2) cannot set a Player’s name (lacking permission 4).

  3. Tried to find solutions to this but so far none have come up that can help me.

Code from LocalScript


local Button = script.Parent
local Frame = script.Parent.Parent.Frame
local ExitButton = Frame.ExitButton
local TeamNameInput = Frame.TeamNameInput.Text
local TeamColorInput = Frame.TeamColorInput.Text
local CreateButton = Frame.CreateButton
local RemoteEvent = game.ReplicatedStorage.CreateTeam
local TeamName = script.TeamName
local TeamColor = script.TeamColor
local Player = game.Players.LocalPlayer

Button.MouseButton1Click:Connect(function()
	Frame.Visible = true
end)

CreateButton.MouseButton1Click:Connect(function()
	local Team = Instance.new("Team")
	TeamName.Value = TeamNameInput
	TeamColor.Value = BrickColor.new(TeamColorInput)
	print(TeamColor.Value)
	RemoteEvent:FireServer(Team, TeamName, TeamColor)
end)

ExitButton.MouseButton1Click:Connect(function()
	Frame.Visible = false
end)

while wait() do
	if Player:GetRankInGroup(6355525) >= 200 then
		script.Parent.Visible = true
		script.Parent.Parent.ImageLabel.Visible = true
	else
		script.Parent.Visible = false
	end
end

Code from Script in ServerScriptService

local Teams = game.Teams
local RemoteEvent = game.ReplicatedStorage.CreateTeam

RemoteEvent.OnServerEvent:Connect(function(Team, TeamName, TeamColor)
	Team.Name = tostring(TeamName)
	Team.TeamColor = BrickColor.new(tostring(TeamColor))
	Team.Parent = Teams
end)

The first parameter of .OnServerEvent is a player instance, so you should add that, then try again.

so u mean from the local script u do:

local Player = game.Players.LocalPlayer

and inside the FireServer:

RemoteEvent:FireServer(Player, Team, TeamName, TeamColor)

?

No, edit the server script like this:

RemoteEvent.OnServerEvent:Connect(function(Player,Team, TeamName, TeamColor)
	Team.Name = tostring(TeamName)
	Team.TeamColor = BrickColor.new(tostring(TeamColor))
	Team.Parent = Teams
end)

yes but u need to add a parameter to the FireServer otherwise Team will get Put as Player in the OnServerEvent

No it won’t.

so this?

local Button = script.Parent
local Frame = script.Parent.Parent.Frame
local ExitButton = Frame.ExitButton
local TeamNameInput = Frame.TeamNameInput.Text
local TeamColorInput = Frame.TeamColorInput.Text
local CreateButton = Frame.CreateButton
local RemoteEvent = game.ReplicatedStorage.CreateTeam
local TeamName = script.TeamName
local TeamColor = script.TeamColor
local Player = game.Players.LocalPlayer

Button.MouseButton1Click:Connect(function()
	Frame.Visible = true
end)

CreateButton.MouseButton1Click:Connect(function()
	local Team = Instance.new("Team")
	TeamName.Value = TeamNameInput
	TeamColor.Value = BrickColor.new(TeamColorInput)
	print(TeamColor.Value)
	RemoteEvent:FireServer(Team, TeamName, TeamColor)
end)

ExitButton.MouseButton1Click:Connect(function()
	Frame.Visible = false
end)

while wait() do
	if Player:GetRankInGroup(6355525) >= 200 then
		script.Parent.Visible = true
		script.Parent.Parent.ImageLabel.Visible = true
	else
		script.Parent.Visible = false
	end
end
local Teams = game.Teams
local RemoteEvent = game.ReplicatedStorage.CreateTeam

RemoteEvent.OnServerEvent:Connect(function(Player, Team, TeamName, TeamColor)
	Team.Name = tostring(TeamName)
	Team.TeamColor = BrickColor.new(tostring(TeamColor))
	Team.Parent = Teams
end)

and

local Teams = game.Teams
local RemoteEvent = game.ReplicatedStorage.CreateTeam

RemoteEvent.OnServerEvent:Connect(function(Team, TeamName, TeamColor)
	Team.Name = tostring(TeamName)
	Team.TeamColor = BrickColor.new(tostring(TeamColor))
	Team.Parent = Teams
end)

?

Yes, but this script is being replaced.

so this? it didnt work when i did it

local Button = script.Parent
local Frame = script.Parent.Parent.Frame
local ExitButton = Frame.ExitButton
local TeamNameInput = Frame.TeamNameInput.Text
local TeamColorInput = Frame.TeamColorInput.Text
local CreateButton = Frame.CreateButton
local RemoteEvent = game.ReplicatedStorage.CreateTeam
local TeamName = script.TeamName
local TeamColor = script.TeamColor
local Player = game.Players.LocalPlayer

Button.MouseButton1Click:Connect(function()
	Frame.Visible = true
end)

CreateButton.MouseButton1Click:Connect(function()
	local Team = Instance.new("Team")
	TeamName.Value = TeamNameInput
	TeamColor.Value = BrickColor.new(TeamColorInput)
	print(TeamColor.Value)
	RemoteEvent:FireServer(Team, TeamName, TeamColor)
end)

ExitButton.MouseButton1Click:Connect(function()
	Frame.Visible = false
end)

while wait() do
	if Player:GetRankInGroup(6355525) >= 200 then
		script.Parent.Visible = true
		script.Parent.Parent.ImageLabel.Visible = true
	else
		script.Parent.Visible = false
	end
end
RemoteEvent.OnServerEvent:Connect(function(Player,Team, TeamName, TeamColor)
	Team.Name = tostring(TeamName)
	Team.TeamColor = BrickColor.new(tostring(TeamColor))
	Team.Parent = Teams
end)
1 Like

Have you tried printing out the values you’re sending before firing the remote?

I tried printing out the brickcolor when I added a brickcolorvalue and it always stayed as Medium grey. I’ll try again later

This line should be in server not client cuz in server cant find team so that why happend error and tell me
Which line cause error tjust try instance team from server not client first

I am not trying to find a team I’m trying to create a team but ok I’ll try that

Also whenever I tested it I pressed the create button and a team with no name and Medium grey brickcolor which is probably the default Color was created but this was yesterday so idk about if it will today.

Which line you get error and tell me team created good?

I’m only on mobile rn but when I am in the game and I’ve pressed the button the blank team is still created but there is no error which means the output is wrong somehow.

Take this tip anyway dont instance anything in client and send it to server cuz hacker can easily instance infinte of teams this first when you in server can check about everyting about player when firing remote like team or have team to check cant instance more than one team i already made team create gui with color list to choose color but my first time to see this error

Is this going to solve the problem and make the teams less vulnerable to hackers and exploiters?

Did i do anything else wrong with team create gui?

Try it but in same time must do it cuz dont give chances to hacker to destroy your game and i saw in your client you check if player have rank at client can easily hacker edit 200 number and act like he get rank in group and get gui so easily anyway when you on pc tell us which line cause error