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

3 comments
No didnt work
Can you tell me the errors it gave you?
There I edited it, should've have come easy to you. It used to be :Connect(Touch) but that wasn't a valid function. It's touched,