mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Actor support 2 and inheritance
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
"StarterPlayer": {
|
"StarterPlayer": {
|
||||||
"StarterPlayerScripts": {
|
"StarterPlayerScripts": {
|
||||||
"PlayerRoot -rapid": {
|
"rapid-PlayerRoot": {
|
||||||
"$className": "Actor",
|
"$className": "Actor",
|
||||||
"Player": {
|
"Player": {
|
||||||
"$path": "src/client/Player"
|
"$path": "src/client/Player"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"StarterCharacterScripts": {
|
"StarterCharacterScripts": {
|
||||||
"CharacterRoot -rapid": {
|
"rapid-CharacterRoot": {
|
||||||
"$className": "Actor",
|
"$className": "Actor",
|
||||||
"$path": "src/client/Character"
|
"$path": "src/client/Character"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
local CrouchModule = {
|
local CrouchModule = {
|
||||||
|
IsCrouching = false,
|
||||||
StandHeight = 2.1,
|
StandHeight = 2.1,
|
||||||
CrouchHeight = .6,
|
CrouchHeight = .6,
|
||||||
WalkSpeedMultiplier = 6,
|
WalkSpeedMultiplier = 6,
|
||||||
@@ -23,6 +24,7 @@ function CrouchModule:Crouch(StandingWalkSpeed: number)
|
|||||||
HipHeight = CrouchModule.CrouchHeight,
|
HipHeight = CrouchModule.CrouchHeight,
|
||||||
WalkSpeed = math.max(1, StandingWalkSpeed-CrouchModule.WalkSpeedMultiplier)
|
WalkSpeed = math.max(1, StandingWalkSpeed-CrouchModule.WalkSpeedMultiplier)
|
||||||
}, Easing)
|
}, Easing)
|
||||||
|
CrouchModule.IsCrouching = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function CrouchModule:Stand(CrouchingWalkSpeed: number)
|
function CrouchModule:Stand(CrouchingWalkSpeed: number)
|
||||||
@@ -32,6 +34,7 @@ function CrouchModule:Stand(CrouchingWalkSpeed: number)
|
|||||||
HipHeight = CrouchModule.StandHeight,
|
HipHeight = CrouchModule.StandHeight,
|
||||||
WalkSpeed = math.max(1, CrouchingWalkSpeed+CrouchModule.WalkSpeedMultiplier)
|
WalkSpeed = math.max(1, CrouchingWalkSpeed+CrouchModule.WalkSpeedMultiplier)
|
||||||
}, Easing)
|
}, Easing)
|
||||||
|
CrouchModule.IsCrouching = false
|
||||||
end
|
end
|
||||||
|
|
||||||
return CrouchModule
|
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()
|
task.spawn(function()
|
||||||
while Spine.Running do
|
while Spine.Running do
|
||||||
local IsFirstPerson = Player.CameraMode == Enum.CameraMode.LockFirstPerson
|
self.Remote:FireServer(self.CurrentCamera.CFrame, Player.CameraMode == Enum.CameraMode.LockFirstPerson)
|
||||||
self.Remote:FireServer(self.CurrentCamera.CFrame, IsFirstPerson)
|
|
||||||
|
|
||||||
Delta:time()
|
Delta:time()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ local HumanoidSettings = HumanoidModule.constructor(Humanoid)
|
|||||||
local SpineMovement = SpineModule.constructor(CurrentCamera)
|
local SpineMovement = SpineModule.constructor(CurrentCamera)
|
||||||
local Flashlight = FlashlightModule.constructor()
|
local Flashlight = FlashlightModule.constructor()
|
||||||
|
|
||||||
local Walking = 10/2 --10 is default
|
|
||||||
local ClientBindMap = BindModule.constructor(false)
|
local ClientBindMap = BindModule.constructor(false)
|
||||||
|
|
||||||
local function ClientCharacterBinds()
|
local function ClientCharacterBinds()
|
||||||
|
|||||||
Reference in New Issue
Block a user