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

How do I add certain items to certain ranks on roblox studio?

Asked by
Luck_k 0
6 years ago

I really wana add admin to a rank, but i Dont want everyone else to have it please help! THANK YOU

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Main Idea Ranks to me is something that shows different levels of importance to a player. That is what you are trying to do, so I am here to help.

Let's Begin

We will start by going to services and insert the team service to your game. Now there will be two teams. Admin and Standard. Now we will make the standard team Auto Assignable. Now let's Insert a local script into the Service Script Storage. Now we will type a script that will Put certain players into the Admin team

local admin1 = game.Players."Jim" -- Jim being one of the admins
local admin2 = game.Players."You" -- You get the idea

while true do
admin1.Team = Admin
admin2.Team = Admin -- Add more if neccesary
end

Now that we have done that, we will give everyone in the Admin team certain tools.(I'm guessing this is what you wanted.

Now we will add tools to the team. To do this we will Insert a Local Script into the Starter Gui. Then we will put our tool into Replicated Storage And copy the name onto the clipboard. In the local script we will type the following:

local AdminGear = 
game.ReplicatedStorage:WaitForChild("Tool") --Change the name to whatever your tool is.

basically what that does, is it tells the server what the tool or tools you want the team to get.

now we will make sure the player that receives this script, is in the Admin Team.

local AdminGear = 
game.ReplicatedStorage:WaitForChild("Tool")

local plr = script.Parent.Parent

if plr.Team.Name == Admin then
AdminGear:Clone().Parent = plr.Backpack
else
 print("NotAdmin")
end

Ad
Log in to vote
0
Answered by 6 years ago

so, lets go through this;

-- admin
local admin = game.Players.Luck_k
local admin2 = game.Players.FriendlyFriendManGuy
-- end admin

admin.Team = Admin
admin2.Team = Admin

then, we'd use a Team Only Tools script.

function teamFromColor(color) 
for _,t in pairs(game:GetService("Teams"):GetChildren()) do 
if t.TeamColor==color then return t end 
end 
return nil 
end 

function onSpawned(plr) 
local tools = teamFromColor(plr.TeamColor):GetChildren() 
for _,c in pairs(tools) do 
c:Clone().Parent = plr.Backpack 
end 
end 

function onChanged(prop,plr) 
if prop=="Character" then 
onSpawned(plr) 
end 
end 

function onAdded(plr) 
plr.Changed:connect(function(prop) 
onChanged(prop,plr) 
end) 
end 

game.Players.PlayerAdded:connect(onAdded)

put the tools you want in the Admin team, and you're all set my dude

0
I had a dif way of doing it, and i worked. You just stole my idea and everything, not ok bro JakePlays_TV 97 — 6y
0
what? i had the same idea for teams, sorry irid_leas 97 — 6y

Answer this question