How would I make a group rank spawn?

  1. What do you want to achieve?
  • I want to make a group rank spawn, that spawns people in a certain spawn only if their rank is eligible.
  1. What is the issue?
  • I tried my best using the RespawnLocation property but it didn’t seem to work.

If you know any solutions or properities that can help in this situation it would be appreciated.

local Players = game:GetService("Players")

local function playerAdded(player)
	if player:GetRankInGroup(6240119) >= 10 then
		
	end
end

Players.PlayerAdded:Connect(playerAdded)
2 Likes

Try making a spawn position like a block and just CFrame the player’s HRP to that

local Players = game:GetService("Players")

local function playerAdded(player)
	if player:GetRankInGroup(6240119) >= 10 then
		local char = plr.Character or plr.ChracterAdded:Wait()
		local hrp = character:FindFirstChild("HumanoidRootPart")
		if char and hrp then
			hrp.CFrame = CFrame.new() -- or a part's cframe
		end
	end
end

Players.PlayerAdded:Connect(playerAdded)
6 Likes

Where do i place that, and how can i edit it.

what you are gonna do is make a spawnpoint where you want the group rank spawn to be and heres the script youre gonna paste:

local Players = game:GetService("Players")
local Spawnpoint = workspace:FindFirstChild("Paste the group rank spawn name here")

local function playerAdded(player)
	if player:GetRankInGroup(6240119) >= 10 then
		player.RespawnLocation = Spawnpoint
	end
end

Players.PlayerAdded:Connect(playerAdded)

it should work

1 Like

The script isn’t working, i placed it in ServerScriptService and Workspace but still not working

@AlloPhoenix Make sure the rank “10” in the group you have provided is valid, other than that, make sure the spawnpoint is not a part but an instance of the class SpawnLocation and that its path is defined correctly and its name is unique. Other than that the script @Ilyas_xx123 has provided but missed a
) at the end, should work.

i didnt realize i missed the )

Am a new scripter, and i did everything that you’ve told me, but i still don’t get the “Instance Spawnpoint” thing.

the name says what it is a point for players to spawn

local Players = game:GetService("Players")
local Spawnpoint = workspace:FindFirstChild("Ranger") --My Spawnlocation and Team name

local function playerAdded(player)
	if player:GetRankInGroup("group") == 255 then -- Group ID and rank
		player.RespawnLocation = Spawnpoint
	end
end

Players.PlayerAdded:Connect(playerAdded)

Is there something wrong ?

what is the error you are recieving?
if there is no error then it should work fine

It keeps spawning me in the wrong team.

what do you mean with that owen?

I tried this and it worked for me

local SpawnPart = game.Workspace.Part -- Set this to the part you want (Not a spawn part but a regular part)
local GroupID = 6240119 --Set this to your group id
game.Players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(GroupID) >= 10 then
		player.Character:MoveTo(SpawnPart.Position+Vector3.new(0,2.5,0))
		player.CharacterAdded:Connect(function(char)
			wait()
			char:MoveTo(SpawnPart.Position+Vector3.new(0,2.5,0))
		end)
	end
end)

Edit it to your liking!
It teleports the player to the part every time they respawn and when they spawn for the first time.

4 Likes