After the "else" statement it works fine it just is not checking if the player has the asset.
It is not giving me no errors it just goes right to the else statement even though the player does have the Asset.
This is a local script in a gui.
local MarketplaceService = game:GetService("MarketplaceService")
local Main = script.Parent
local Galaxy = script.Parent.Parent:FindFirstChild('Galaxy')
local GalaxyButton = script.Parent:FindFirstChild('GalaxyButton')
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Quit = script.Parent.Parent.Galaxy:FindFirstChild('Quit')
local Buy = script.Parent.Parent.Galaxy:FindFirstChild('Buy')
GalaxyButton.MouseButton1Down:connect(function()
local Asset = 25171036
local hasAsset = false
local success, message = pcall(function()
Asset = MarketplaceService:PlayerOwnsAsset(player, Asset)
end)
if not success then
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasAsset == true then
wait(.5)
game.player.Backpack.Tool.Handle.Mesh.TextureId = "rbxassetid://2783168872"
else
Main.Visible = false
Galaxy.Visible = true
Quit.Visible = true
end
end)

1 comment
You never change hasAsset.