I am trying to create a teleport script that lets me teleport players from one place to another place only if they are above a certain rank in my group. When I click the button to teleport the player it doesn’t teleport me and I also see this error:
Could you check over my script to see what is wrong with it?
local GroupId = 1234567
if game.Players:GetRankInGroup(GroupId) >= 201 then
script.Parent.Visible = true
elseif game.Players:GetRankInGroup(GroupId) <= 252 then
script.Parent.Visible = false
end
script.Parent.MouseButton1Down:Connect(function()
game:GetService("TeleportService"):Teleport(7331292232)
end)