Please someone help me to fix this ISSUE idk what happen to roblox im not sure if this is bug in my game or bug from ROBLOX?
HERE My Script
local player = game:GetService(“Players”).LocalPlayer
local BadgeService = game:GetService(“BadgeService”)
local MarketplaceService = game:GetService(“MarketplaceService”)
local RS = game:GetService(“ReplicatedStorage”)
local ItemGiver = RS:WaitForChild(“Remote”):WaitForChild(“ItemGiver”)
local leader = player:WaitForChild(“NonLeaderStats”)
local level = leader:WaitForChild(“Level”)
local Button = script.Parent
local txt = Button:WaitForChild(“TextLabel”)
local ASSET_ID = 14287857178
local ASSET_NAME = “Medium Golden Hair with Pink Cap”
level.Changed:Connect(function()
if level.Value >= 50 then
Button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
txt.Text = “Claim”
Button.Active = true
else
Button.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
txt.Text = “Lock”
Button.Active = false
end
end)
game.Players.PlayerAdded:Connect(function(player)
if level.Value >= 50 then
Button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
txt.Text = “Claim”
Button.Active = true
else
Button.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
txt.Text = “Lock”
Button.Active = false
end
spawn(function()
local _success, doesPlayerOwnAsset = pcall(MarketplaceService.PlayerOwnsAsset, MarketplaceService, player, ASSET_ID)
if doesPlayerOwnAsset then
Button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
txt.Text = "Claimed"
Button.Active = false
else
warn("go get the item")
end
end)
end)
Button.Activated:Connect(function()
– level.Changed:Connect(function()
if level.Value == 50 then
if level.Value >= 50 then
spawn(function()
local _success, doesPlayerOwnAsset = pcall(MarketplaceService.PlayerOwnsAsset, MarketplaceService, player, ASSET_ID)
if doesPlayerOwnAsset then
print(player.Name … " owns " … ASSET_NAME)
else
print(player.Name … " doesn’t own " … ASSET_NAME)
MarketplaceService:PromptPurchase(player, ASSET_ID)
end
end)
end
end
– end)
end)