I want to make a group rank spawn, that spawns people in a certain spawn only if their rank is eligible.
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)
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)
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)
@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.
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)
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.