I've created a script which is supposed to make a doors collisions on or off depending on if the player owns the gamepass, and i only want the door to be non collidable for the players that HAVE the gamepass. It doesn't work i think the error is in line 8?
local mps = game:GetService("MarketplaceService")
local id = 8503267
local granted = game.ReplicatedStorage.Events.PremiumAccessGranted
local denied = game.ReplicatedStorage.Events.PremiumAccessDenied
game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Touched:Connect(function(part)
if mps:UserOwnsGamePassAsync(plr, id) then
granted:FireClient()
else
denied:FireClient()
end
end)
end)
granted.OnServerEvent:Connect(function()
script.Parent.CanCollide = false
end)
denied.OnServerEvent:Connect(function()
script.Parent.CanCollide = true
end)

5 comments
fire client needs to be received by a local script with OnClientEvent
oh ill try something
it hasnt worked ive made the local script make the parts collision off it hasnt worked
i have just fixed your code
there are so many problems with this, check my answer