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

My billboardgui isnt cloning, or at least it seems to not?

Asked by 3 years ago
Edited 3 years ago
DamageEvent.OnClientEvent:Connect(function(damage,hit)
    print('absahdbhbdwhh')
    if damage == 10 then
        local Billboard = Instance.new("BillboardGui")
        Billboard.AlwaysOnTop = true
        local DamageLabel = Instance.new("TextLabel")
        DamageLabel.BackgroundTransparency = 1
        DamageLabel.Position = UDim2.new(0.25,0,0.25,0)
        DamageLabel.Size = UDim2.new(0.5,0,0.5,0)
        DamageLabel.Font = Enum.Font.SciFi
        DamageLabel.Text = "-10"
        DamageLabel.TextSize = 24
        DamageLabel.TextStrokeTransparency = 0
        DamageLabel.TextColor3 = DamageColours["10"]
        DamageLabel.Parent = Billboard
        Billboard.Parent = hit
        --print(Billboard.Parent)
    elseif damage == 5 then
        local Billboard = Instance.new("BillboardGui")
        Billboard.AlwaysOnTop = true
        local DamageLabel = Instance.new("TextLabel")
        DamageLabel.BackgroundTransparency = 1
        DamageLabel.Position = UDim2.new(0.25,0,0.25,0)
        DamageLabel.Size = UDim2.new(0.5,0,0.5,0)
        DamageLabel.Font = Enum.Font.SciFi
        DamageLabel.Text = "-5"
        DamageLabel.TextSize = 24
        DamageLabel.TextStrokeTransparency = 0
        DamageLabel.TextColor3 = DamageColours["5"]
        DamageLabel.Parent = Billboard
        Billboard.Parent = hit
        --print(Billboard.Parent)
        print('a')
    end
end)

im making a sword and this script is to make a billboardgui appear on wherever it got hit (the dmg taken)

This is in a LocalScript. It can print 'absahdbhbdwhh' and 'a' no problem. But when i uncomment the print(billboard.parent) nothing comes out in the output.

The hit parameter is whoever got hit by the sword, thats why billboard.parent = hit

Is it because I cannot make a new Instance of a BillBoardGui in LocalScript?

If thats true, i tried the same code without the remote event but just straight up in a server sided script. WHen i look at the workspace the billboard gui is cloned no problem but i cannot see the gui????

note: no error messages at all

all hep is appreciated ty

0
This script is very inneficient and hard to manage. Try making it more dependant on the damage dealt rather then having a whole extra 15 lines. Also, this isn't cloning, it's making something exactly like something else. TheB4dComputer 100 — 3y

Answer this question