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

[HELP]Brick spawn being interfered with sword?

Asked by 8 years ago

Okay so here is what i want to happen when i press the button 'F': http://imgur.com/leeZIAU this works fine, however when i press it with my sword equiped(so when its a child of the character) this then happens: http://imgur.com/QWsLK8D Here is the code for the brick spawn:

local mouse = game.Players.LocalPlayer:GetMouse()
local player = game.Players.LocalPlayer

function Ability()
    if player.Character then
        local Character = player.Character
                    local Brick = Instance.new("Part",game.Workspace)
                    Brick.CanCollide = false
                    Brick.Anchored = true
                    Brick.Size = Vector3.new(1,1,1)
                    Brick.BrickColor = BrickColor.new("New Yeller")
                    Brick.Transparency = 0.5
                    Brick.TopSurface = Enum.SurfaceType.Smooth
                    Brick.CFrame = Character.Head.CFrame
                        for r = 1,13,1 do
                                wait()
                            --Brick.CFrame = Character.Head.CFrame
                            Brick.Size = Vector3.new(r,r,r)
                        end
                Brick:Destroy()
        end
end

mouse.KeyDown:connect(function(key)
    key = key:lower()
    if key == "f" then --Change this to any Keys but I reccomand leaving it as [F] key.
        Ability()
    end
end)

I was wondering why this happens, espiecially as the sword is not collidable thanks for any help ~Bubs

1 answer

Log in to vote
0
Answered by
Vexture 179
8 years ago

The issue is that your BillboardGui is not set to always be on top. To do this, all you have to do is set the BillboardGui's AlwaysOnTop property to true.

0
i did this, and nothing seemed to happen Bubbles5610 217 — 8y
Ad

Answer this question