Well, i was trying to make a gamepass script that when you touch it, it teleports you to another game i'm still a beginner and i need help.
Input a Server Script in ServerScriptService with the following code or refer to the bottom for a better alternative
-- >> Server Script Service local gamepassID = 000 -- Change to your gamepass ID local placeID = 000 local TS = game:GetService("TeleportService") local MS = game:GetService("MarketplaceService") workspace.Part.Touched:Connect(function(hit) -- On touch event if hit.Parent:FindFirstChild("Humanoid") then -- Finds a humanoid if it's a player local plr = game.Players:GetPlayerFromCharacter(hit.Parent) -- Sets the player if MS:UserOwnsGamePassAsync(plr.UserId, gamepassID) then -- Checks if the player owns the pass TS:Teleport(placeID, plr) -- Teleports the player to the place end end end) -- >> Better alternative -- Local Script In Starter Gui local plr = game.Players.LocalPlayer local MS = game:GetService("MarketplaceService") local TS = game:GetService("TeleportService") local passID = 000 local placeID = 000 workspace.Part.Touched:Connect(function(hit) -- On touch event if MS:UserOwnsGamePassAsync(plr.UserId, passID) then -- Checks if the player owns the pass TS:Teleport(placeID, plr) -- Teleports the player to the place end end)