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

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

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)

1 comment

0

Please use the Lua code block button to format your code so that it is readable

1 answer

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) 

1 comment

0

PLEASE tab and space properly! The amount to increment by in a for loop defaults to 1; you can remove those

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