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

Can't Figure Out What's Wrong...?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

The script is contained within the ClickDetector. But when you click on the brick containing the ClickDetector, nothing happens. I'm not sure what's wrong. Help?

function onMouseClick()

game.Lighting.Ambient = {0,0,0} game.Workspace.Installation.EmergencyLights.Part.SpotLight.Enabled = true

local h = Instance.new("Hint") h.Parent = game.Workspace h.Text = "Emergency system reboot engaged, please stand by" wait(3)

h.Text = "System reboot beginning" wait(0.2) h.Text = "System reboot beginning ." wait(0.2) h.Text = "System reboot beginning . ." wait(0.2) h.Text = "System reboot beginning . . ." wait(0.2) h.Text = "[| ]" wait(0.5) h.Text = "[|| ]" wait(0.5) h.Text = "[||| ]" wait(0.5) h.Text = "[|||| ]" wait(0.5) h.Text = "[||||| ]" wait(0.5) h.Text = "[|||||| ]" wait(0.5) h.Text = "[||||||| ]" wait(0.5) h.Text = "[|||||||| ]" wait(0.5) h.Text = "[||||||||| ]" wait(0.5) h.Text = "[|||||||||| ]" wait(0.5) h.Text = "[||||||||||| ]" wait(0.5) h.Text = "[|||||||||||| ]" wait(0.5) h.Text = "[||||||||||||| ]" wait(0.5) h.Text = "[|||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||| ]" wait(0.5) h.Text = "[|||||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||||| ]" wait(0.5) h.Text = "[|||||||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||||||| ]" wait(0.5) h.Text = "[|||||||||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||||||||| ]" wait(0.5) h.Text = "[|||||||||||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||||||||||| ]" wait(0.5) h.Text = "[||||||||||||||||||||||||]" wait(0.5)

h.Text = "System reboot successful" wait(2) h:Remove()

game.Lighting.Ambient = {300,300,300} game.Workspace.Installation.EmergencyLights.Part.SpotLight.Enabled = false

end

script.Parent.MouseClick:connect(onMouseClick)

0
Please use the Lua code block button to format your code so that it is readable BlueTaslem 18071 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

use lua code block to display the code correctly like this, also you can make this code smaller by using loops:- http://wiki.roblox.com/index.php?title=Loop

Hade some spare time so I fixed it

function onMouseClick() 
local h = Instance.new("Hint")   
h.Parent = game.Workspace  
h.Text = "Emergency system reboot engaged, please stand by"  
wait(3) 
sysRebTxt="System reboot beginning" 
h.Text =  sysRebTxt
addon=" ."
for i=0,3 ,1 do
    sysRebTxt=sysRebTxt .. addon
    h.Text = sysRebTxt
    wait(0.2)
end

addon="|"
curTxt=""
for i=0,25,1 do
    curTxt=curTxt .. addon
    h.Text ="[" .. curTxt .. "]"
    wait(0.5)
end 
wait(0.5) 
h.Text = "System reboot successful" 
wait(2)  
h:Remove() 
end 

script.Parent.MouseButton1Click:connect(onMouseClick) 
0
PLEASE tab and space properly! The amount to increment by in a `for` loop defaults to `1`; you can remove those BlueTaslem 18071 — 9y
Ad

Answer this question