I was in the middle of making a training centre for someone, and I tried to modify my Group Rank Door so it respawns a user if they touch it and if they are not above the RequiredRank.
Script:
local GroupId = 11501504
local RequiredRank = 11
local Player = game.Players.LocalPlayer
for i, v in pairs(game.Workspace:WaitForChild("RankDoors"):GetChildren()) do
if v:IsA("Part") then
if Player:GetRankInGroup(GroupId) >= RequiredRank then
v.CanCollide = true
else
if Player:GetRankInGroup(GroupId) <= RequiredRank then
game.Players:GetPlayerFromCharacter(Humanoid):LoadCharacter()
end
end
end
end
The rank door was designed to be in StarterGUI. I’ve used this loads but I’ve recently configured it to respawn a player when they are below a certain rank.
Load character can only be called from the backend server, might as well remove that line, it doesn’t really help you, in theory that line in general doesn’t make much sense, every part inside of the “RankDoors” directory would just reload the character.
for i, v in pairs(game.Workspace:WaitForChild("RankDoors"):GetChildren()) do
if v:IsA("Part") then
v.Touched:Connect(function()
--Rest of script here
end)
end
end