Hello all.
As you can most likely tell from the title, I need a script for group rank team only items.
I have an idea as to what it's like but I know that it would not work.
Here is my idea:
local plr = game.Players.LocalPlayer local grouprank = plr.GetRankInGroup: 4207836 local team = plr.TeamColor if plr grouprank => 100 then if plr team = Really black game.ReplicatedStorage.X26:give game.ReplicatedStorage.Handcuffs:give end
Could I get some help? Thanks!
if
statement, which is bound to throw you an error. You're doing the same for checking their team. Tool
s don't have a give
method, you'll need to clone the tools inside the player's backpack/starter gear. You seem to be using a LocalScript
, don't. Put this code in a server script (Script
, not local/module) under ServerScriptService
game:GetService("Players").PlayerAdded:Connect(function(plr) local rank = plr:GetRankInGroup(4207836) -- You can also say: plr.GetRankInGroup(plr, 4207836) . The above line is syntax sugar for plr.GetRankInGroup(plr, 4207836) if rank >= 100 then -- the > was behind the =, it's >= not => if plr.TeamColor == BrickColor.new("Really black") then -- BrickColor constructor for _, item in pairs(game:GetService("ReplicatedStorage"):GetChildren()) do -- Iterate through the children of replicatedstorage if item.Name == "X26" or item.Name == "Handcuffs" then -- if name is x26 or handcuffs item:Clone().Parent = plr.Backpack item:Clone().Parent = plr.StarterGear -- Create clones of the item, clone to backpack and starter gear. StarterGear cloned the item to the backpack when the humanoid dies. end end end end end)