Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to give a certain player access to change other players' teams?

Asked by 2 years ago

For example, there are 12 players in a game. 2 are admins and the others are normal players. I want to give access to admins to like, for example, change the team of the 5 players to blue and the other 5 players to red. I want to give access to admins to add more teams, too. Oh, by the way, I want to put this in a GUI.

1 answer

Log in to vote
-1
Answered by 2 years ago
Edited 2 years ago

To Give Access To Only Admins You Can Do

local admins = {"RazorXX2", "OTHERUSER"}

local player = game.Players.LocalPlayer

if player.name == admins then
    script.parent.visible = true -- make sure it is a local script and script is inside gui frame
end

to make admins make teams you can do

script.Parent.MouseButton1Click:Connect(function()
    local newteam = Instance.new("Team")
    newteam.Parent = Teams
    newteam.Name = " NAME"
end)

i wont answer more as this isnt a request site

0
the script is not even correct, you need to use a pairs loop and loop through the table and see if one of the player matches with the table corresponding value, it's not valid to see if a player name is equal to a table Xapelize 2658 — 2y
0
you should never trust the client with any important data because exploiters can easily manipulate it, and that includes the names of admins OfficerBrah 494 — 2y
Ad

Answer this question