Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help me with this gamepass GUI?

Asked by 10 years ago

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!

01print("teleport")
02brick = workspace["Tele3"]
03player = script.Parent.Parent.Parent.Parent.Character
04 
05local passId = ########  -- Id of gamepass here!
06 
07function HasGamePass(Player)
08    return game:GetService("GamePassService"):PlayerHasPass(player, PassId)
09end
10 
11 
12 
13game.Players.PlayerAdded:connect(HasGamePass)
14if HasGamePass(plr) then
15    function tele()
View all 25 lines...

2 answers

Log in to vote
0
Answered by 10 years ago

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".

Ad
Log in to vote
0
Answered by 9 years ago

This might work better.

01--Make sure this is on the correct TextButton on StarterGui.
02 
03print("teleport")
04brick = 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.
05player = script.Parent.Parent.Parent.Parent.Character
06 
07local passId = "PUT GAMEPASS ID HERE"  -- Id of gamepass here!
08 
09game:GetService("GamePassService"):PlayerHasPass(player, passId):connect(HasGamePass)
10 
11game.Players.PlayerAdded:connect(HasGamePass)
12if HasGamePass(player) then
13    function tele()
14player.Torso.CFrame = brick.CFrame + Vector3.new(0,4,0)
15    end
View all 21 lines...

NOTE : This is untested. It may or may not work. Hope this helped! If it worked, please accept my answer!

Answer this question