local plr = game.Players.LocalPlayer
if game.MarketplaceService:UserOwnsGamePassAsync(plr.UserId, 18133269) then
local adoor = game.Workspace.GamepassDoor2
adoor.Parent = game.Workspace.CurrentCamera
adoor:Destroy()
else
local door = game.Workspace:FindFirstChild("GamepassDoor2"):Clone()
door.Parent = game.Workspace.CurrentCamera
door.CanCollide = true
door.Anchored = true
door.CFrame = game.Workspace.GamepassDoor2.CFrame
door.Touched:Connect(function()
if game.MarketplaceService:UserOwnsGamePassAsync(plr.UserId, 18133269) ~= true then
game.MarketplaceService:PromptGamePassPurchase(plr, 18133269)
end
end)
end
It is a localscript in starterpack

8 comments
Uh, so when I replace it from door.Touched to the end of the script it doesnt prompt the gamepass ui. Any suggestions?
Does it give any errors?
It says this: Error: (20,6) Syntax error: Expected 'end' (to close 'else' at line 7), got <eof>; did you forget to close 'then' at line 16?
Apparently, you forgot to add an "end" to close the statement "else at line 7", but the lua interpreter found the end of the script instead.
Add a "end" at the end of the script and itll work fine. I guess.
I'm stuck on where to put another end? Can you help me? Thanks!
RIGHT I c now, thanks
https://i.imgur.com/M7DW72g.png