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
Hello. Have you considered searching in this site before asking a question, in order to see if your same question has been answered before?
Anyways, the script doesnt care whether it is you that touched the wall or someone else. To fix it, you need to check if the part is from the localplayer's character or not.
door.Touched:Connect(function(part) --the part that hit local player = game.Players.LocalPlayer --localplayer if part:IsDescendantOf(player.Character) then --checks if the part that hit the door is from the localplayer's character or not, therefore only prompting him game.MarketplaceService:PromptGamePassPurchase(plr, 18133269) end end)
I hope this helps.
If you have any questions, feel free to ask them below.