How can i make timecode in roblox

local Time = 0

local function atTime(x)
	wait(x - Time)
	Time += x
end

atTime(3)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(4)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end

atTime(6)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(8)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(9.4)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(9.7)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(11.4)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(13.3)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end
atTime(15)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0
	v.Head.Beam.light.Transparency = NumberSequence.new(0)

	v.Head.Beam.SpotLight.Enabled = true
end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.25
	v.Head.Beam.light.Transparency = NumberSequence.new(0.25)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.5
	v.Head.Beam.light.Transparency = NumberSequence.new(0.5)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 0.75
	v.Head.Beam.light.Transparency = NumberSequence.new(0.75)

end
wait(0.001)
for i,v in pairs (game.Workspace.LLights:GetChildren())
do
	v.Head.Lens.Transparency = 1
	v.Head.Beam.light.Transparency = NumberSequence.new(1)

	v.Head.Beam.SpotLight.Enabled = false
end

1. You can’t do wait() with a number less than 1/30.
2. If you actually meant to do something that listens for audio intensity you could’ve used Sound.PlaybackLoudness, it will return a number between 1 and 1000 to tell you how loud is your music at the moment so you can actually make some cool effects with it.

1 Like

i already have a script with play back loudness for an automatic show but i need one that uses the songs position for i am making time code

Yeah The script I sent you works perfectly when I try it so I don’t know what’s the issue you are having

1 Like