#Script for An vip only door not working

36 messages · Page 1 of 1 (latest)

mental notch
#

Hello I have got en error message when i try to make an vip only door with a script the script is located as a local script in starterplayer scripts the proplem is that the door doesnt disaper after you habe bought the gamepass. I hope that somebody can help me.

local player = game.Players.LocalPlayer
local gamepassId = 12345678

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepass) == true
game.Workspace.GamepassDoor.CanCollide = false then
game.Workspace.GamepassDoor.Transparency = 0.5
end

end

brisk phoenix
#
local player = game.Players.LocalPlayer
local gamepassId = 12345678

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) == true then
    game.Workspace.GamepassDoor.CanCollide = false
game.Workspace.GamepassDoor.Transparency = 0.5 
end
mental notch
#

It still doesnt work a new error comes that says GamepassDoor is not a valid member of Workspace Workspace

brisk phoenix
#

And you can fix that yourself!

#

Cuz with no more context we cant help

mental notch
#

And how can i fix that

brisk phoenix
#

workspace:WaitForChild("GamepassDoor")

#

Basicly the door has not been loaded in yet

mental notch
#

Ok i have tryde it but then you could walk throug the door too when you dont have bought the gamepass

brisk phoenix
#

So we wait for the door to load

mental notch
#

no i need to buy it

#

at the start

brisk phoenix
#

If u created it

#

U own it

mental notch
#

Oh ok yes then its working

#

local player = game.Players.LocalPlayer
local gamepassId = 12345678

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) then
local door = game.Workspace:WaitForChild("GamepassDoor")
if door then
door.CanCollide = false
door.Transparency = 1
else
warn("GamepassDoor not found in Workspace")
end
end would that code work too

#

Thank you Its working now

brisk phoenix
#

Yea

#

That looks good

mental notch
#

Ok but now i have an other issue i want to connect my gamepass to the code but a item catalog has the same id

buoyant gobletBOT
#

studio** You are now Level 2! **studio

mental notch
#

what do i need to do to fix it

brisk phoenix
#

Wdym? To the code?

#

And 2 items should not have the same Id? I think you must’ve mistaken

mental notch
#

wait

#

thats the gamepass id 755398734

#

but there is a tshirt to with the same id

brisk phoenix
mental notch
#

i have checkt

#

wait i send you the links

#

but i dind make the tshirt

brisk phoenix
#

thats weird