whats wrong with this script
local debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == false then
wait()
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local GamePassId = script.Parent.GamepassId
local marketplaceservice = game:GetService("MarketplaceService")
if player and marketplaceservice:PlayerOwnsAsset(player, gamepassId.Value) then
script.Parent.CanCollide = false
wait(.5)
script.Parent.CanCollide = true
end
end
wait(2)
debounce = false
end)
it says GamepassId is not a valid member of Part

1 comment
I'm going to assume that this is a Script, and according to my testing, it will error if you capitalize wrong (game.Workspace.name will error, game.Workspace.Name will not). My suggestion is for you to make sure that all references of GamepassId in your code is typed exactly the same, as I think it's case sensitive.