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

BillboardGui script not working?

Asked by
lucas4114 607 Moderation Voter
8 years ago

I'm new to BillboardGuis and I'm trying to make a particle thing but it doesn't work... there are no errors in the output.

local particlepos = script.Parent.Parent.Part.Position 
local particleid = "rbxassetid://133293265"
local particlesize = UDim2.new(0,10,0,10)
local particlerate = 0.5
local particlelife = 2

local db = false

script.Parent.Touched:connect(function(part)
    if db == false then
        db = true
        if part.Parent:FindFirstChild("Humanoid") then
            local particle = Instance.new("BillboardGui")
            local pospart = Instance.new("Part")
            pospart.Anchored = true
            pospart.CanCollide = false
            pospart.Transparency = 1
            pospart.Position = particlepos
            pospart.Parent = game.Workspace
            particle.Adornee = pospart
            local particleview = Instance.new("ImageLabel")
            particleview.Size = UDim2.new(1,0,1,0)
            particleview.Image = particleid
            particleview.Parent = particle
            particle.Parent = game.Workspace
            game:GetService("Debris"):AddItem(particle, particlelife)
            game:GetService("Debris"):AddItem(pospart, particlelife)
        end
        wait(particlelife)
        db = false
    end
end)

Answer this question