mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 23:01:53 +00:00
Actor support 2 and inheritance
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local CrouchModule = {
|
||||
IsCrouching = false,
|
||||
StandHeight = 2.1,
|
||||
CrouchHeight = .6,
|
||||
WalkSpeedMultiplier = 6,
|
||||
@@ -23,6 +24,7 @@ function CrouchModule:Crouch(StandingWalkSpeed: number)
|
||||
HipHeight = CrouchModule.CrouchHeight,
|
||||
WalkSpeed = math.max(1, StandingWalkSpeed-CrouchModule.WalkSpeedMultiplier)
|
||||
}, Easing)
|
||||
CrouchModule.IsCrouching = true
|
||||
end
|
||||
|
||||
function CrouchModule:Stand(CrouchingWalkSpeed: number)
|
||||
@@ -32,6 +34,7 @@ function CrouchModule:Stand(CrouchingWalkSpeed: number)
|
||||
HipHeight = CrouchModule.StandHeight,
|
||||
WalkSpeed = math.max(1, CrouchingWalkSpeed+CrouchModule.WalkSpeedMultiplier)
|
||||
}, Easing)
|
||||
CrouchModule.IsCrouching = false
|
||||
end
|
||||
|
||||
return CrouchModule
|
||||
23
src/client/Character/Client/Sneak.lua
Normal file
23
src/client/Character/Client/Sneak.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local Sneak = {
|
||||
IsSneaking = false,
|
||||
Walk = 10,
|
||||
Sneaking = 10/2 --10 is default
|
||||
}
|
||||
Sneak.__index = Sneak
|
||||
|
||||
function Sneak.constructor(HumanoidSettingsInherent, Humanoid: Humanoid)
|
||||
return setmetatable({
|
||||
Humanoid = Humanoid,
|
||||
HumanoidSettingsInherent = HumanoidSettingsInherent
|
||||
}, Sneak)
|
||||
end
|
||||
|
||||
function Sneak:Enable()
|
||||
self.HumanoidSettingsInherent:SetWalkSpeed(Sneak.Sneaking)
|
||||
end
|
||||
|
||||
function Sneak:Disable()
|
||||
self.HumanoidSettingsInherent:SetWalkSpeed(Sneak.Walk)
|
||||
end
|
||||
|
||||
return Sneak
|
||||
@@ -32,9 +32,7 @@ function Spine:Enable()
|
||||
|
||||
task.spawn(function()
|
||||
while Spine.Running do
|
||||
local IsFirstPerson = Player.CameraMode == Enum.CameraMode.LockFirstPerson
|
||||
self.Remote:FireServer(self.CurrentCamera.CFrame, IsFirstPerson)
|
||||
|
||||
self.Remote:FireServer(self.CurrentCamera.CFrame, Player.CameraMode == Enum.CameraMode.LockFirstPerson)
|
||||
Delta:time()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -46,7 +46,6 @@ local HumanoidSettings = HumanoidModule.constructor(Humanoid)
|
||||
local SpineMovement = SpineModule.constructor(CurrentCamera)
|
||||
local Flashlight = FlashlightModule.constructor()
|
||||
|
||||
local Walking = 10/2 --10 is default
|
||||
local ClientBindMap = BindModule.constructor(false)
|
||||
|
||||
local function ClientCharacterBinds()
|
||||
|
||||
Reference in New Issue
Block a user