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

how to give leaderbord rank ingame if plr is in group? [closed]

Asked by 4 years ago

Hello can anyone help me I search a script if plr is in group then plr teamcolor white AND then plr role : IsIngroup pls I need help

Closed as Not Constructive by imKirda and Cynical_Innovation

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

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

**local Group = 5700758 -- Your group ID local MinimumLevel = 50 -- Group rank power

local Team = "MyTeam"

game.Players.PlayerAdded:Connect(function(player) local Power = player:GetRankInGroup(Group) if tonumber(Power) >= MinimumLevel then -- if you want it to match a power use '==' print("Setting Team") player.Team = game:GetService("Teams")["MyTeam"] end return true end)**

-- Also sorry for poor formatting, I have no idea how to use this site lol

Ad
Log in to vote
0
Answered by 4 years ago

I'm not sure if this will work or not but I'm trying my best, make sure it's a script in ServerScriptService. And make sure that in your leaderstats script that the Value is a BoolValue

local groupId = -- put your group id here

game.Players.PlayerAdded:Connect(function(newPlayer)
    if newPlayer:IsInGroup(groupId) then
        newPlayer.leaderstats.RankNameHere.Value = "Group Guy" -- change "RankNameHere" with your real rank and "Group Guy" with what you want to give them.
    end
end)