How to make the screen blink red?

  1. What do you want to achieve? Make the screen blink red like this.

  2. What is the issue? Im using TweenService but i dont know how to make the screen blink.

  3. What solutions have you tried so far? I tried to look at DevForum but i din’t found a solution.

My script:

local TweenService = game:GetService("TweenService") 
local twInfo = TweenInfo.new(5)
local killCC = game.Lighting.kills10

wait(20)

killCC .Enabled = true

local
 tw = TweenService:Create(killCC , twInfo, {
	 TintColor = Color3.new(1, 0, 0)
	{TintColor = Color3.new(0.364706, 0, 0)}
	{TintColor = Color3.new(1, 0, 0)}
	{TintColor = Color3.new(0.333333, 0, 0)}
	{TintColor = Color3.new(1, 1, 1)}

})

tw:Play()

This is my script that i tried to make the screen blink, whats wrong here?

2 Likes

Are you sure this is not on purpose? beacuse im sure killCC.Enabled = true is the right one.

1 Like

You don’t really need to use the tween service, you could just put it in a loop:

local killCC = game.Lighting.kills10
killCC.Parent = nil

while true do
    wait(20)
    killCC.Parent = game.Lighting
    wait(20)
    killCC.Parent = nil
end
1 Like

This doesn’t really matter, that is only un needed white-space

1 Like

Im trying to do the screen blink like this as you can see in the video.

1 Like

I edited my script, see if it works now

2 Likes

Did you saw the video? Im trying to do the screen like in the video.

2 Likes

Is there any errors in the output?

2 Likes
--game.Workspace.test:11: attempt to call a Color3 Value
2 Likes

Maybe this is may solve your issue:

3 Likes

Since you want those exact colours, here’s a way to do it:

local TweenService = game:GetService("TweenService") 
local twInfo = TweenInfo.new(5)
local killCC = game.Lighting.kills10

wait(20)

killCC.Enabled = true

TweenService:Create(killCC, twInfo, {TintColor = Color3.new(1, 0, 0)}):Play()
wait(5)
TweenService:Create(killCC, twInfo, {TintColor = Color3.new(0.364706, 0, 0)}):Play()
wait(5)
TweenService:Create(killCC, twInfo, {TintColor = Color3.new(1, 0, 0)}):Play()
wait(5)
TweenService:Create(killCC, twInfo, {TintColor = Color3.new(0.333333, 0, 0)}):Play()
wait(5)
TweenService:Create(killCC, twInfo, {TintColor = Color3.new(1, 1, 1)}):Play()

Feel free to edit and customise to meet your needs. Hopefully this works…
Make sure the script is in ServerScriptService (if a server Script), or in StarterPlayerScripts (if a LocalScript).

2 Likes

Try this! it works perfectly in my game.

(goes into startergui)

local tw = game:GetService('TweenService')

local tinfo = TweenInfo.new(
	.4
)

local tween = tw:Create(game.Lighting.ColorCorrection, tinfo, {TintColor = Color3.fromRGB(255, 0, 0)})
local tween2 = tw:Create(game.Lighting.ColorCorrection, tinfo, {TintColor = Color3.fromRGB(190, 0, 0)})

wait(5)
print('starting .. or not idk')

tween:Play()
tween.Completed:Wait()

tween2:Play()
tween2.Completed:Wait()

tween:Play()
tween.Completed:Wait()

tween2:Play()
tween2.Completed:Wait()

tween:Play()
game.Lighting.ColorCorrection.TintColor = Color3.fromRGB(255, 0, 0)

video – robloxapp-20220824-2019003.wmv (208.5 KB)

2 Likes

You don’t need to have multiple tweens, simply set the tweeninfo repeatcount to the number of times you want it to repeat.

Here is a localscript that will do what you want:

local TS = game:GetService("TweenService")
local twInfo = TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,5) -- last number here is the amount of times the tween will repeat. here it is set to 5, so it will repeat 5 times for a total of 2.5 seconds
local killCC = game.Lighting.effectCC -- change this to your colorcorrection effect's name
local tween = TS:Create(killCC,twInfo,{TintColor = Color3.fromRGB(132, 0, 0)})


function flashCC()
	killCC.Enabled = true
	killCC.TintColor = Color3.fromRGB(255, 0, 0)
	tween:Play()
	tween.Completed:Connect(function()
		killCC.Enabled = false
	end)
end

wait(5)
flashCC()
2 Likes

Look at the property values, they’re different.

1 Like