This is a module for your effects!
Getting it set up
First get this model link:
https://web.roblox.com/library/9697404307/EffectModule
Then import it into your game.
Now you want to require it.
local EffectModule = require(script:WaitForChild("EffectModule"))
So lets say you want a fast heartbeat effect well it has it:
local EffectModule = require(script:WaitForChild("EffectModule"))
wait(2)
while task.wait(1) do
EffectModule("Heartbeat")
end
How to add a custom effect
This is simple.
In the module code you should add a elseif statement after line 84.
elseif EffectType == "Your custom effect name here" then
Then inside of that you can add a tween like this example:
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 120})
Tween:Play()
Simple!
Source code
--[[
Effect Module:
BlankScreen
FastHeartbeat
Sprint1
Sprint2
LowHealth1
LowHealth2
]]
local Lighting = game:GetService("Lighting")
local TweenService = game:GetService("TweenService")
local Camera = workspace.CurrentCamera
local blankScreen = Instance.new("ColorCorrectionEffect")
blankScreen.Name = "BlankScreen"
blankScreen.Parent = Lighting
local redScreen = Instance.new("ColorCorrectionEffect")
redScreen.Name = "LowHealthScreen"
redScreen.Parent = Lighting
local function SetEffectType(EffectType)
if EffectType == "BlankScreen" then
local ti = TweenInfo.new(10)
local Tween = TweenService:Create(blankScreen, ti, {Brightness = 1})
Tween:Play()
script:WaitForChild("Tinnitus"):Play()
task.spawn(function()
Tween.Completed:Connect(function()
TweenService:Create(blankScreen, TweenInfo.new(1), {Brightness = 0}):Play()
script:WaitForChild("Tinnitus"):Stop()
end)
end)
elseif EffectType == "Heartbeat" then
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 80})
Tween:Play()
script:WaitForChild("Heartbeat"):Play()
task.spawn(function()
Tween.Completed:Connect(function()
TweenService:Create(Camera, ti, {FieldOfView = 70}):Play()
script:WaitForChild("Heartbeat"):Stop()
end)
end)
elseif EffectType == "Sprint1" then
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 90})
Tween:Play()
elseif EffectType == "Sprint2" then
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 70})
Tween:Play()
elseif EffectType == "LowHealth1" then
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 50})
script:WaitForChild("Breath"):Play()
TweenService:Create(redScreen, ti, {TintColor = Color3.new(1, 0, 0)}):Play()
Tween:Play()
elseif EffectType == "LowHealth2" then
local ti = TweenInfo.new(0.5)
local Tween = TweenService:Create(Camera, ti, {FieldOfView = 70})
script:WaitForChild("Breath"):Stop()
TweenService:Create(redScreen, ti, {TintColor = Color3.new(1, 1, 1)}):Play()
Tween:Play()
else
warn(EffectType.." is not a effect type.")
end
end
return SetEffectType
A example
So yeah this is a end of the page.