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

Why won't this script end the message?

Asked by 10 years ago

Hello, I have just made this script but when it ends, it just stays on the last message and never goes away..

Please can someone help? :)

Thanks!

local p = Instance.new("Hint",game.Workspace)

function onClick()
p.Text = 90
Wait (1)
p.Text = 89
Wait (1)
p.Text = 88
Wait (1)
p.Text = 87
Wait (1)
p.Text = 86
Wait (1)
p.Text = 85
Wait (1)
p.Text = 84
Wait (1)
p.Text = 83
Wait (1)
p.Text = 82
Wait (1)
p.Text = 81
Wait (1)
p.Text = 80
Wait (1)
p.Text = 79
Wait (1)
p.Text = 78
Wait (1)
p.Text = 77
Wait (1)
p.Text = 76
Wait (1)
p.Text = 75
Wait (1)
p.Text = 74
Wait (1)
p.Text = 73
Wait (1)
p.Text = 72
Wait (1)
p.Text = 71
Wait (1)
p.Text = 70
Wait (1)
p.Text = 69
Wait (1)
p.Text = 68
Wait (1)
p.Text = 67
Wait (1)
p.Text = 66
Wait (1)
p.Text = 65
Wait (1)
p.Text = 64
Wait (1)
p.Text = 63
Wait (1)
p.Text = 62
Wait (1)
p.Text = 61
Wait (1)
p.Text = 60
Wait (1)
p.Text = 59
Wait (1)
p.Text = 58
Wait (1)
p.Text = 57
Wait (1)
p.Text = 56
Wait (1)
p.Text = 55
Wait (1)
p.Text = 54
Wait (1)
p.Text = 53
Wait (1)
p.Text = 52
Wait (1)
p.Text = 51
Wait (1)
p.Text = 50
Wait (1)
p.Text = 49
Wait (1)
p.Text = 48
Wait (1)
p.Text = 47
Wait (1)
p.Text = 46
Wait (1)
p.Text = 45
Wait (1)
p.Text = 44
Wait (1)
p.Text = 43
Wait (1)
p.Text = 42
Wait (1)
p.Text = 41
Wait (1)
p.Text = 40
Wait (1)
p.Text = 39
Wait (1)
p.Text = 38
Wait (1)
p.Text = 37
Wait (1)
p.Text = 36
Wait (1)
p.Text = 35
Wait (1)
p.Text = 34
Wait (1)
p.Text = 33
Wait (1)
p.Text = 32
Wait (1)
p.Text = 31
Wait (1)
p.Text = 30
Wait (1)
p.Text = 29
Wait (1)
p.Text = 28
Wait (1)
p.Text = 27
Wait (1)
p.Text = 26
Wait (1)
p.Text = 25
Wait (1)
p.Text = 24
Wait (1)
p.Text = 23
Wait (1)
p.Text = 22
Wait (1)
p.Text = 21
Wait (1)
p.Text = 20
Wait (1)
p.Text = 19
Wait (1)
p.Text = 18
Wait (1)
p.Text = 17
Wait (1)
p.Text = 16
Wait (1)
p.Text = 15
Wait (1)
p.Text = 14
Wait (1)
p.Text = 13
Wait (1)
p.Text = 12
Wait (1)
p.Text = 11
Wait (1)
p.Text = 10
Wait (1)
p.Text = 9
Wait (1)
p.Text = 8
Wait (1)
p.Text = 7
Wait (1)
p.Text = 6
Wait (1)
p.Text = 5
Wait (1)
p.Text = 4
Wait (1)
p.Text = 3
Wait (1)
p.Text = 2
Wait (1)
p.Text = 1
Wait (1)
p.Text = 0
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
p.Text = "The results have been verified"
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
p.Text = "The results have been verified"
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
end
script.Parent.ClickDetector.MouseClick:connect(onClick)

2 answers

Log in to vote
6
Answered by
TofuBytes 500 Moderation Voter
10 years ago

Just a small side note onto both question and answer. You can actually simplify the lines of code in this script. This is just in-case you want to use a simplified version.

local p = Instance.new("Hint",game.Workspace)

function onClick()
for countdown=90,0,-1 do
p.Text = (countdown)
wait(1)
end
p.Text = "The results have been verified!"
wait(5)
p:Destroy()
end

script.Parent.ClickDetector.MouseClick:connect(onClick)
0
Thank you sir! I am increasing my knowing of Lua everyday! WelpNathan 307 — 10y
0
No problem! :) TofuBytes 500 — 10y
Ad
Log in to vote
2
Answered by
Seraine 103
10 years ago
local p = Instance.new("Hint",game.Workspace)

function onClick()
p.Text = 90
Wait (1)
p.Text = 89
Wait (1)
p.Text = 88
Wait (1)
p.Text = 87
Wait (1)
p.Text = 86
Wait (1)
p.Text = 85
Wait (1)
p.Text = 84
Wait (1)
p.Text = 83
Wait (1)
p.Text = 82
Wait (1)
p.Text = 81
Wait (1)
p.Text = 80
Wait (1)
p.Text = 79
Wait (1)
p.Text = 78
Wait (1)
p.Text = 77
Wait (1)
p.Text = 76
Wait (1)
p.Text = 75
Wait (1)
p.Text = 74
Wait (1)
p.Text = 73
Wait (1)
p.Text = 72
Wait (1)
p.Text = 71
Wait (1)
p.Text = 70
Wait (1)
p.Text = 69
Wait (1)
p.Text = 68
Wait (1)
p.Text = 67
Wait (1)
p.Text = 66
Wait (1)
p.Text = 65
Wait (1)
p.Text = 64
Wait (1)
p.Text = 63
Wait (1)
p.Text = 62
Wait (1)
p.Text = 61
Wait (1)
p.Text = 60
Wait (1)
p.Text = 59
Wait (1)
p.Text = 58
Wait (1)
p.Text = 57
Wait (1)
p.Text = 56
Wait (1)
p.Text = 55
Wait (1)
p.Text = 54
Wait (1)
p.Text = 53
Wait (1)
p.Text = 52
Wait (1)
p.Text = 51
Wait (1)
p.Text = 50
Wait (1)
p.Text = 49
Wait (1)
p.Text = 48
Wait (1)
p.Text = 47
Wait (1)
p.Text = 46
Wait (1)
p.Text = 45
Wait (1)
p.Text = 44
Wait (1)
p.Text = 43
Wait (1)
p.Text = 42
Wait (1)
p.Text = 41
Wait (1)
p.Text = 40
Wait (1)
p.Text = 39
Wait (1)
p.Text = 38
Wait (1)
p.Text = 37
Wait (1)
p.Text = 36
Wait (1)
p.Text = 35
Wait (1)
p.Text = 34
Wait (1)
p.Text = 33
Wait (1)
p.Text = 32
Wait (1)
p.Text = 31
Wait (1)
p.Text = 30
Wait (1)
p.Text = 29
Wait (1)
p.Text = 28
Wait (1)
p.Text = 27
Wait (1)
p.Text = 26
Wait (1)
p.Text = 25
Wait (1)
p.Text = 24
Wait (1)
p.Text = 23
Wait (1)
p.Text = 22
Wait (1)
p.Text = 21
Wait (1)
p.Text = 20
Wait (1)
p.Text = 19
Wait (1)
p.Text = 18
Wait (1)
p.Text = 17
Wait (1)
p.Text = 16
Wait (1)
p.Text = 15
Wait (1)
p.Text = 14
Wait (1)
p.Text = 13
Wait (1)
p.Text = 12
Wait (1)
p.Text = 11
Wait (1)
p.Text = 10
Wait (1)
p.Text = 9
Wait (1)
p.Text = 8
Wait (1)
p.Text = 7
Wait (1)
p.Text = 6
Wait (1)
p.Text = 5
Wait (1)
p.Text = 4
Wait (1)
p.Text = 3
Wait (1)
p.Text = 2
Wait (1)
p.Text = 1
Wait (1)
p.Text = 0
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
p.Text = "The results have been verified"
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
p.Text = "The results have been verified"
Wait (1)
p.Text = "The results have been verified!"
Wait (1)
p:remove() -- You need to remove the text
end
script.Parent.ClickDetector.MouseClick:connect(onClick)

Hope this helps!

0
Worked perfectly. Thank you! :) WelpNathan 307 — 10y

Answer this question