Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tool destroying not working in GamePass script?

Asked by 4 years ago

So, I'm trying to make a script where if you own a GamePass, you get a bazooka, and get to explode a volcano. Here is my script:

local market = game:GetService("MarketplaceService")
local ID = 6089351
game.Players.PlayerAdded:Connect(function(p)
    p.Chatted:Connect(function(msg)
    if msg:lower() == ":volcano" then
    if market:UserOwnsGamePassAsync(p.UserId, ID) then
        while true do
            local Lava = Instance.new("Part", workspace.Volcano)
            Lava.Position = workspace.Volcano.Explode.Position + Vector3.new(0,5,0)
            Lava.Anchored = false
            Lava.Material = Enum.Material.Neon
            Lava.Color = BrickColor.new("Br. yellowish orange").Color
            local Force = Instance.new("VectorForce", Lava)
            local ForceAttachment = Instance.new("Attachment", Lava)
            Lava.Touched:Connect(function(hit)
                hit:Destroy()
            end)
            Force.Force = Vector3.new(0,1000,0)
            Force.Attachment0 = ForceAttachment
            wait(0.1)
        end
    else 
        market:PromptGamePassPurchase(p, 6089351)
        p.Backpack.bazooka:Destroy()
    end
    end
    end)
end)

The problem is, the bazooka is not destroying. The volcano is working, just not the bazooka destroying. (P.S. I have other scripts, they're working, just not this bazooka one.)

1 answer

Log in to vote
0
Answered by 4 years ago

I answered it myself

Ad

Answer this question