I need it so if the rank 255 steps on the block, it will teleport them to another block, but if any other rank steps on it, it won't teleport them. Here is what I have in the teleport block.
local Teleport = "Teleport-2" local config = script.Parent.Parent.Configuration function Touch(hit) if part.Parent and game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then local player = game:GetService('Players'):GetPlayerFromCharacter(part.Parent) if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then local Pos = script.Parent.Parent:findFirstChild(Teleport) hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false script.Parent.Touched:connect(Touch) end end
That's kind of messy so I decided to rescript it for you.
local teleport-2 = game.Workspace:FindFirstChild("TELEPORTERNAME") local ID = 0 local RANKID = 0 local function Touched(hit) if part.Parent and game.Players:FindFirstChild(part.Parent.Name) then local player = game.Players:FindFirstChild(part.Parent.Name) if player:GetRankInGroup(ID) >= RANKID then part.Parent:MoveTo(teleport-2) end end end script.Parent.Touched:Connect(Touched)
This should work, I'm not to sure since I didn't test.
I changed a few things from d1_rek's answer, and it worked. Here it is if anyone needs it!
local teleport = workspace.Teleport local ID = 6235192 local RANKID = 254 local function Touched(part) if part.Parent and game.Players:FindFirstChild(part.Parent.Name) then local player = game.Players:FindFirstChild(part.Parent.Name) if player:GetRankInGroup(ID) <= RANKID then player.Character:MoveTo(teleport.Position) end end end script.Parent.Touched:Connect(Touched)