-- events


REMOTES.Finished.OnClientEvent:connect(function()
	SCOPE_GUI.Visible	= false
	MOUSE_GUI.Visible	= false
	
	script.Disabled	= true
end)

SCOPE_GUI:GetPropertyChangedSignal("Visible"):connect(function()
	script.ScopeSound:Play()
	
	if SCOPE_GUI.Visible then
		Lighting.ScopeBlur.Enabled	= true
		Lighting.ScopeBlur.Size		= 32
		
		SCOPE_GUI.Size		= UDim2.new(1.1, 0, 1.1, 0)
		
		local info	= TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
		local blurTween		= TweenService:Create(Lighting.ScopeBlur, info, {Size = 0})
		local scopeTween	= TweenService:Create(SCOPE_GUI, info, {Size = UDim2.new(1.4, 0, 1.4, 0)})
		
		blurTween:Play()
		scopeTween:Play()
	else
		Lighting.ScopeBlur.Enabled	= false
	end
end)

EVENTS.Aim.Event:connect(function(a)
	aiming	= a
	UpdateScope()
end)

EVENTS.Scope.Event:connect(function(s)
	scope	= s
	UpdateScope()
end)

EVENTS.Sway.Event:connect(function(sway)
	scopeSpring:Shove(sway)
end)

EVENTS.Hitmarker.Event:connect(Hitmarker)

REMOTES.Hitmarker.OnClientEvent:connect(Hitmarker)
