Module:
local Module = {}
function Module:ScreenShake(move)
local length = 0
if move == 'heavyattack' then
length = .15
elseif move == 'blockbreakground' then
length = .15
elseif move == 'blockbreakair' then
length = .25
end
return length
end
Local Function:
tool.Action.OnClientEvent:Connect(function(action,tuple1,tuple2)
if action == 'screenshake' then
local fx = require(tool.FX)
local st = fx:ScreenShake(tuple1)
local otfx = true
local toggle = coroutine.wrap(function()
wait(st)
otfx = false
end)
toggle()
while otfx == true do
wait()
local currenttime = tick()
local bobbleX = math.cos(currenttime * 30 ) * 1
local bobbleY = math.abs(math.sin(currenttime * 30 )) * 1
local bobble = Vector3.new(bobbleX,bobbleY,0)
char.Humanoid.CameraOffset = char.Humanoid.CameraOffset:lerp(bobble,.25)
end
end
end)
This only returns one value, but the value changes, why’s it firing the error “Module did not return exactly one value”?