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

I need help on a group rank spawn?

Asked by
redqxi 0
3 years ago

I need a script where it spawns a specific group rank/role. But everytime I use my script it ends up spawning anyone??

2 answers

Log in to vote
0
Answered by 3 years ago

I'm not sure if this is what you meant but..

-- locals:
local GroupId = 9218769

game.Players.PlayerAdded:Connect(function(localPlr)
    repeat wait() until localPlr.Character
    local PlayersRank = localPlr:GetRoleInGroup(GroupId)
    if PlayersRank == "Owner" and "Co-owner" then
        localPlr.Character.HumanoidRootPart.CFrame = game.Workspace.TeleportSpawn.CFrame
        print(localPlr, "teleported to secret room")
    end
end)

Change the GroupId to the GroupId you got so it works.

How it works is when the player joins it repeats till their character spawns. Then it gets their Role from the GroupId.

If the Players Role/Rank is Owner or Co-owner then it'll teleport them to this part's CFrame. then it'll print in the server script that the player teleported to a secret room.

(You can add more PlayerRanks by doing "if PlayersRank == "Blah" and "Blah" and "Blah" then" just add another and and yeaa)

If this is what you meant then here you go.

Ad
Log in to vote
-2
Answered by 3 years ago

Hey, I made my own one, it works for me hopefully it helps you too!

Group rank spawn: https://www.roblox.com/library/6340593157/Group-rank-spawn

Accept my answer if it works! Make sure you change the rank number and group id for it to work!

Answer this question