Why doesn't this Gamepass script work?
01 | local passId = 396490188 |
03 | function isAuthenticated(player) |
04 | return game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player, passId) |
07 | game.Players.PlayerAdded:connect( function (plr) |
08 | if isAuthenticated(plr) then |
09 | print (plr.Name .. " has bought the game pass with id " .. passId) |
13 | game:GetService( "TeleportService" ).CustomizedTeleportUI = true |
14 | local teleportService = game:GetService( "TeleportService" ) |
15 | local otherPlaceId = 215389447 |
16 | local button = script.Parent |
17 | local loadingScreen = script.Parent.Parent |
18 | local player = game.Players.LocalPlayer |
20 | button.MouseButton 1 Down:connect( function () |
21 | game:GetService( "TeleportService" ):Teleport(otherPlaceId, player) |
22 | loadingScreen.Visible = true |
24 | loadingScreen.BackgroundTransparency = i |
27 | loadingScreen.BackgroundTransparency = 0 |
Thanks for answering!
The goal of the script is to see if you have the game pass and if you do teleport you to another part of the universe. I tested the script out ingame and when I touched the part that was suppose to do that It wasn't doing it and I can't spot anything wrong with this script so I came to you guys for help, again thanks! :)