Hello, I am trying to make a Team Creator GUI that creates Teams using inputs of the Team Name and Team Color in BrickColor.
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).
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)
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)
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
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
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.
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
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