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

Text Label Change Function?

Where is Says Function onTouch(Hit) I want the Textlabel Text To Change. For Some Reason That is Not Working, There is nothing in the output Help?

Nar = script.Parent
Shatter = script.Shatter
Toolname = "Candle"
WinAct = game.Workspace.WindowAct


wait(100)
Shatter:play()
wait(1.4)
Shatter:stop()
Nar.Text = "Wha? What was that?"
wait(6)
Nar.Text = "It's Dark In The Halls, I Should grab something to light my way."

function onTouch(hit)
script.Parent.Text = "Shattered? Somthing Isnt Right..."
end
script.Parent.Parent.Parent.Parent.WindowAct.Touched:connect(onTouch)

1 comment

0

roleplaying level = -1

1 answer

✓ Accepted answer

This should work :

Nar = script.Parent
Shatter = script.Shatter
Toolname = "Candle"
WinAct = game.Workspace.WindowAct

function onTouch(hit)
	
	script.Parent.Text = "Shattered ? Something isn't right..."
	
end

script.Parent.Parent.Parent.Parent.WindowAct.Touched:connect(onTouch)

wait(100)

Shatter:Play()

wait(1.4)

Shatter:Stop()

Nar.Text = "Wha? What was that?"

wait(6)

Nar.Text = "It's dark in the halls, I should grab something to light my way."

You connected the function after the 2 "wait" so that's why it wasn't working.

1 comment

0

Thank you so Much! Ill be sure to use it like that now!

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