local module = require(game.ServerStorage.SettingsForSci)
local pass = 22467991
local mpService = game:GetService("MarketplaceService")
local haspass
script.Parent.MouseButton1Click:Connect(function(player)
local success,message = pcall(function()
haspass = mpService:UserOwnsGamePassAsync(player.UserId, pass)
end)
if haspass then
print("Yes")
else
warn("No")
mpService:PromptGamePassPurchase(player,pass)
end
end)
my code ^
Why isn’t this working even though I own the gamepass
problem is MouseButton1Down cant get the player at arguments
to fix that! you should check MouseButton1Down in a local script… then fire a remote which is sending the player… then in normal script. get the fired remotes signal. then check if player has gamepass.
hope this heps
can u explain a bit more what do you want to do ?
MouseButton1Click can only used on client, but considering you are using game.ServerStorage, so
i assume it is server script.
bruh use this add this
1- add script in serverscripts and type this
local pass = 22467991
local mpService = game:GetService("MarketplaceService")
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
local haspass = mpService:UserOwnsGamePassAsync(player.UserId, pass)
if haspass then
print("Yes")
else
warn("No")
mpService:PromptGamePassPurchase(player,pass)
end
end)
2 -make RemoteEvent on ReplicatedStorage
3- make button and local script and type this
script.Parent.TextButton.MouseButton1Down:Connect(function()
local pass = 22467991
game.ReplicatedStorage.RemoteEvent:FireServer(pass)
end)