So I am making a gun system and wanted to make a recoil system. I then found this script written by @CraftMaker which works great. The thing is I don’t understand most of the thing, and I want to know what it does.
So there is the script :
game["Run Service"].RenderStepped:Wait()
local randomy = (math.random(0,15*2)-25)/1200
if game.Workspace.CurrentCamera.CFrame.LookVector.Y < 0.9 then
game.Workspace.CurrentCamera.CFrame = game.Workspace.CurrentCamera.CFrame*CFrame.Angles(15/360/2,randomy/4,0)
game["Run Service"].RenderStepped:Wait()
game.Workspace.CurrentCamera.CFrame = game.Workspace.CurrentCamera.CFrame*CFrame.Angles(15/360/2,randomy/4,0)
else
game["Run Service"].RenderStepped:Wait()
end
local value = 0
for i=20,1,-1 do
game["Run Service"].RenderStepped:Wait()
game.Workspace.CurrentCamera.CFrame = game.Workspace.CurrentCamera.CFrame*CFrame.Angles(-15/7200*i/14,randomy/40*i/10,0)
value = value + i/10
end
-- Credits to CraftMaker not me
Thanks for futur reply !