I have the concept of doing this, but the concept failed... I tried checking with a local script by checking with userowngamepassasync on the local player user id and yet it doesn't work...
Anyone know what I should do?
I have the concept of doing this, but the concept failed... I tried checking with a local script by checking with userowngamepassasync on the local player user id and yet it doesn't work...
Anyone know what I should do?
This should be simple:
You can do this with collision groups or by deleting it
MarketplaceService = game:GetService("MarketplaceService")
GamePassID = --Your Gamepass ID here
script.Parent.Touched:Connect(function(Touch)
if Touch.Parent.Humanoid then
local PlayerModel = Touch.Parent:FindFirstAncestorWhichIsA("Model")
Player = game.Players:GetPlayerFromCharacter(PlayerModel)
if not Player then return end
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,GamePassID then
(Set the players collision group here so they dont collide with the part.)
end
end
end)
Edit by request:
MarketplaceService = game:GetService("MarketplaceService")
GamePassID = --Your Gamepass ID here
game.Players.PlayerAdded:Connect(function(Player)
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,GamePassID then
(do whatever here)
end
end)
Helpful Links:
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PromptPurchase https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync
Please consider marking this as the answer if you found this helpful.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
It is much better if CollisionGroups are applied along with Region3 to appropriately make a VIP zone.
How would you do this without a on touched and just when a player loads into the game?
That should do it for you itadakimasu