I made a GUI that teleports a player that has the game pass to be telported to a certain place and if he doesnt have it it wont teleport him! Either way the player is not teleported help me please!
print("teleport") brick = workspace["Tele3"] player = script.Parent.Parent.Parent.Parent.Character local passId = ######## -- Id of gamepass here! function HasGamePass(Player) return game:GetService("GamePassService"):PlayerHasPass(player, PassId) end game.Players.PlayerAdded:connect(HasGamePass) if HasGamePass(plr) then function tele() player.Torso.CFrame = brick.CFrame + Vector3.new(0,4,0) end else print ("Player Does not have game pass!") end script.Parent.MouseButton1Down:connect(tele)
For one, "plr" is a bad parameter. So I suggest to use a different term. Maybe the id is incorrect.I'm not 100% sure but the 3rd line after character maybe it should say " = true".
This might work better.
--Make sure this is on the correct TextButton on StarterGui. print("teleport") brick = workspace.Tele3 --Make sure the brick is in the workspace, not in a model, and make sure the brick name is similar to the brick mentioned in the script. player = script.Parent.Parent.Parent.Parent.Character local passId = "PUT GAMEPASS ID HERE" -- Id of gamepass here! game:GetService("GamePassService"):PlayerHasPass(player, passId):connect(HasGamePass) game.Players.PlayerAdded:connect(HasGamePass) if HasGamePass(player) then function tele() player.Torso.CFrame = brick.CFrame + Vector3.new(0,4,0) end else print ("Player Does not have game pass!") end script.Parent.MouseButton1Down:connect(tele)
NOTE : This is untested. It may or may not work. Hope this helped! If it worked, please accept my answer!