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

Text Label Change Function?

Asked by 9 years ago

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)
0
roleplaying level = -1 ConnorXV 5 — 9y

1 answer

Log in to vote
1
Answered by
Vitou 65 Snack Break
9 years ago

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.

0
Thank you so Much! Ill be sure to use it like that now! TayLife12 69 — 9y
Ad

Answer this question