mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Actor support
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user