Actor support

This commit is contained in:
2024-02-21 13:23:23 -05:00
parent ff16d8ceb3
commit e5f1a546b1
21 changed files with 284 additions and 73 deletions

View File

@@ -3,6 +3,9 @@ local CrosshairModule = {
}
CrosshairModule.__index = CrosshairModule
local Storage = game:GetService("ReplicatedStorage")
local Easings = require(Storage:WaitForChild("AlgebraEasings"))
--Use a custom crosshair so we can do effects to it
type rbxassetid = string
@@ -17,15 +20,24 @@ function CrosshairModule.constructor(PlayerGui: PlayerGui)
end
function CrosshairModule:Enable()
self.Screen.Enabled = true
(self.Screen :: ScreenGui).Enabled = true
end
function CrosshairModule:Disable()
self.Screen.Enabled = false
(self.Screen :: ScreenGui).Enabled = false
end
function CrosshairModule:Change(ID: rbxassetid)
self.Icon.Image = ID or CrosshairModule.Icon
(self.Icon :: ImageLabel).Image = ID or CrosshairModule.Icon
end
function CrosshairModule:Jump(RootVelocity: Vector3)
local X, Y = RootVelocity.X, RootVelocity.Y;
(self.Icon :: ImageLabel).Position = UDim2.fromScale(
Y>1 and Easings.Linear(.5,.5+(X/1000),.3) or .5,
math.clamp(.4, .5-(-Y/1000), .6)
)
end
return CrosshairModule