Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

2 comments

0

char is supposed to be a variable that is  specifically the humanoid not the character

0

also your method didn't work

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

1 comment

0

but thanks for trying to help

This discussion is preserved as it was. New answers, comments, and votes are closed.