我有一个可以工作的销售平台,但现在没有错误消息,但不卖我的鱼。
local Part = script.Parent
local id =158043842
Part.Touched:Connect(function(hit)
local H = hit.Parent:FindFirstChild("Humanoid")
if H then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local leaderstats = player:WaitForChild("leaderstats")
local currency = leaderstats.Coins
local selling = leaderstats.Fish
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
if selling.Value > 0 then
currency.Value = currency.Value + selling.Value * 2
selling.Value = 0
end
else
if selling.Value > 0 then
currency.Value = currency.Value + selling.Value * 1
selling.Value = 0
end
end
end
end
end)
这是一个脚本,不是本地脚本,它位于销售平台内。