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

Why does the text not become more transparent when the humanoid dies?

Asked by 3 years ago
char = game.Workspace["Hamood Summoner"].Major -- the npcs humanoid ignore the name
local textoutlinetransparency = script.Parent.TextStrokeTransparency
local TextTransparency = script.Parent.TextTransparency
script.Parent.Text = game.Workspace["Hamood Summoner"].Name

if char.Died:Connect(function()
        wait(0.05)
        textoutlinetransparency = 0.7
        TextTransparency = 0.7
        wait(0.05)
        textoutlinetransparency = 0.8
        TextTransparency = 0.8
        wait(0.05)
        textoutlinetransparency = 0.9
        TextTransparency = 0.9
        wait(0.05)
        textoutlinetransparency = 1
        TextTransparency = 1
    end)
then

end

i made a script thats supposed to make the text which is supposed to be the overhead name quickly disappear when the humanoid dies but i used the variables to make it less messy and now the text won't become more transparent when the npc dies is there solution to this? i tried not using locals btw

2 answers

Log in to vote
1
Answered by 3 years ago

maybe i was wrong but i never see anyone put if before an event, try this below, also it seems like die is an event of humanoid not character

char.Humanoid.Died:Connect(function()
    wait(0.05)
    textoutlinetransparency = 0.7
    TextTransparency = 0.7
    wait(0.05)
    textoutlinetransparency = 0.8
    TextTransparency = 0.8
    wait(0.05)
    textoutlinetransparency = 0.9
    TextTransparency = 0.9
        wait(0.05)
        textoutlinetransparency = 1
        TextTransparency = 1
end)
0
char is supposed to be a variable that is  specifically the humanoid not the character dylancrazy88 20 — 3y
0
also your method didn't work dylancrazy88 20 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
char = game.Workspace["Hamood Summoner"].Major -- the npcs humanoid you can change the name to the npcs current name and humanoid name
text = script.Parent
script.Parent.Text = game.Workspace["Hamood Summoner"].Name

char.Died:Connect(function() -- function that gets called when the npc poops itself
    wait(0.05)
    text.TextStrokeTransparency = 0.7
    text.TextTransparency = 0.7
    wait(0.05)
    text.TextStrokeTransparency = 0.8
    text.TextTransparency = 0.8
    wait(0.05)
    text.TextStrokeTransparency = 0.9
    text.TextTransparency = 0.9
    wait(0.05)
    text.TextStrokeTransparency = 1
    text.TextTransparency = 1

    end)

turns out i fixed it by myself all i had to do was just make a variable for specifying the text itself it wasn't the event but the variables

0
but thanks for trying to help dylancrazy88 20 — 3y

Answer this question