would anyone be kind enough to give me flashing light scripts, and please tell me how to use them, this would help a lot, thanks!
lemme guess
dark sci-facility flash?
like the screen effect, like the effect in Tech Des
should be easy imo but i don’t think my script is efficient,
put this in localeventscript:
function flash()
local playergui = game.Players.LocalPlayer.PlayerGui
local gui = Instance.new("ScreenGui")
gui.IgnoreGuiInset = true
gui.Parent = playergui
local flash = Instance.new("Frame")
flash.Size = UDim2.fromScale(1,1)
flash.BorderSizePixel = 0
flash.BackgroundColor3 = Color3.new(1,1,1)
flash.Parent = gui
--do not touch above unless you know what you're doing!!!
wait(.1) --delay until it starts fading
game:GetService("TweenService"):Create(flash,TweenInfo.new(1),{BackgroundTransparency = 1}):Play() --change the 1 in tweeninfo for slower fading
game.Debris:AddItem(gui,2) --deletes the gui in 2 seconds
end
flash() --each time you call this function, it flashes player's screen
can you give like a little info on how to use/alter it?
flash.BackgroundColor3 is the flash’s color, i recommend you use “Color3.fromRGB(255,255,255)” instead of “Color3.new(1,1,1)” unless you know how to mix Red, Green, Blue to the color you want while using 1 and not 255.
TweenService makes it so it slowly fade out the tween, you can modify the TweenInfo.new(1), the 1 is in second, and you can change it to make it fade slower.
other than that it’s should be there by default.
example on how to do repeating flash:
while wait(3) do --flashes every 3 seconds
flash()
end
is it infinite, or is there a way to manually stop it?
it is infinite, but you can set for how many times it flash, for example:
for i=1,20 do --20 = amount of time it repeat
flash()
wait(4) --flash then wait 4 seconds before doing again
end
(NOTE: This loop yields, which will prevent any other line of script beyond it from working, use spawn(function() for no yielding)
spawn(function()
for i=1,20 do --20 = amount of time it repeat
flash()
wait(4) --flash then wait 4 seconds before doing again
end
end)
and can i just put a wait before all this so it starts flashing at specific time?
yes, basically like the water rise functions and stuff, although it may be inaccurate but you can try and match it with the bgm
ok, well here are my only question
- you said that the loop will not allow any script beyond that, but you gave to examples, so thats a little confusing.
where would i put this?
3. o k
for i=1,20 do --20 = amount of time it repeat
flash()
wait(4) --flash then wait 4 seconds before doing again
end
--scripts beyond this will not work until the loop stops--
print("ji") --wont print until the loop stops, applies for everything beyond the loop
spawn(function() makes it so it doesnt yield, thus meaning any other scripts beyond it will work normally
anywhere beyond the function, e.g.
function flash()
local playergui = game.Players.LocalPlayer.PlayerGui
local gui = Instance.new("ScreenGui")
gui.IgnoreGuiInset = true
gui.Parent = playergui
local flash = Instance.new("Frame")
flash.Size = UDim2.fromScale(1,1)
flash.BorderSizePixel = 0
flash.BackgroundColor3 = Color3.new(1,1,1)
flash.Parent = gui
--do not touch above unless you know what you're doing!!!
wait(.1) --delay until it starts fading
game:GetService("TweenService"):Create(flash,TweenInfo.new(1),{BackgroundTransparency = 1}):Play() --change the 1 in tweeninfo for slower fading
game.Debris:AddItem(gui,2) --deletes the gui in 2 seconds
end
spawn(function()
for i=1,20 do --20 = amount of time it repeat
flash()
wait(4) --flash then wait 4 seconds before doing again
end
end)
ok, and it goes in event script?
thanks
alr e
you can always ask if something’s wrong
it didn’t work, tell me if i scripted it wrong:
function flash()
local playergui = game.Players.LocalPlayer.PlayerGui
local gui = Instance.new(“ScreenGui”)
gui.IgnoreGuiInset = true
gui.Parent = playergui
local flash = Instance.new(“Frame”)
flash.Size = UDim2.fromScale(1,1)
flash.BorderSizePixel = 0
flash.BackgroundColor3 = Color3.new(1,1,1)
flash.Parent = gui
do not touch above unless you know what you're doing!!!
wait(.1) --delay until it starts fading
game:GetService("TweenService"):Create(flash,TweenInfo.new(1),{BackgroundTransparency = 0.4}):Play() --change the 1 in tweeninfo for slower fading
game.Debris:AddItem(gui,2) --deletes the gui in 2 seconds
end
local Lib = workspace.Multiplayer.GetMapVals:Invoke() --Has: Map, Script, Button, btnFuncs
Lib.Button:connect(function(p, bNo) if Lib.btnFuncs[bNo] then Lib.btnFuncs[bNo](bNo, p) end end)
wait(1)
Lib.Script.moveWater(Lib.Map._Door1, Vector3.new(0, -30, 0), 2, true)
wait(31.5)
Lib.Script.moveWater(Lib.Map._Door2, Vector3.new(0, -30, 0), 2, true)
Lib.Script.moveWater(Lib.Map._NeonDoor1, Vector3.new(0, -30, 0), 2, true)
wait(20)
spawn(function()
for i=1,50 do --50 = amount of time it repeat
flash()
wait(4) --flash then wait 4 seconds before doing again
end
end)
you can delete the messages with –
e.g.
--gg
thats what broke it??
not really unless something in it broke, try turning on “script analysis” in views tab in studio