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

How to make the script say if the player is on a team then do a function? [UNSOLVED]

Asked by 9 years ago
                                                                                                     --[[
    Copyright® 2015 Code Much? 
                                                                                                      --]]
--[[
    To get this script to work, you need to do one script for ONE (1) tool for every tool.  If you have any
    problems, contact CoderOfTheMonth.
--]]


local groupId = 0 -- Group Id V - Put tool in ServerStorage OR change that to Lighting and put the tool in lighting.
local tool = game.ServerStorage -- Tool
function onPlayerSpawned(player)
    if player:IsIngroup(groupId) then 
        tool:Clone().Parent = player.Backpack
    end
end

game.Players.PlayerAdded:connect(function(player)
  player.CharacterAdded:connect(function()
    onPlayerSpawned(player)
  end)
end)

function onPlayerSpawned(player)
  if player:GetRankInGroup(groupId) >= 0 and  then -- Rank ID
    tool:Clone().Parent = player.Backpack
  end
end
0
Do you mean group, or actual in game team? Be more specific and if it is for an actual game team then have a go for yourself, if it's for the group TELL US WHERE THE ERROR IS OR IF YOU HAVE AN ERROR! General_Scripter 425 — 9y
0
I have no error, I want it to be a group, rank and if the player is on a certain team, they get the tools CoderOfTheMonth 0 — 9y

Answer this question