mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 22:11:54 +00:00
Ladder contacts
This commit is contained in:
23
src/client/Character/Client/Actions.lua
Normal file
23
src/client/Character/Client/Actions.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local Actions = {
|
||||
ActionCurrent = false,
|
||||
Walk = 10,
|
||||
Sneaking = 10/2 --10 is default
|
||||
}
|
||||
Actions.__index = Actions
|
||||
|
||||
function Actions.constructor(HumanoidSettingsInherent, Humanoid: Humanoid)
|
||||
return setmetatable({
|
||||
Humanoid = Humanoid,
|
||||
HumanoidSettingsInherent = HumanoidSettingsInherent
|
||||
}, Actions)
|
||||
end
|
||||
|
||||
function Actions:Enable()
|
||||
self.HumanoidSettingsInherent:SetWalkSpeed(Actions.Sneaking)
|
||||
end
|
||||
|
||||
function Actions:Disable()
|
||||
self.HumanoidSettingsInherent:SetWalkSpeed(Actions.Walk)
|
||||
end
|
||||
|
||||
return Actions
|
||||
@@ -1,23 +0,0 @@
|
||||
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
|
||||
@@ -58,12 +58,19 @@ local function ClientCharacterBinds()
|
||||
CrouchConstructor:Stand(5)
|
||||
end)
|
||||
--Walk
|
||||
ClientBindMap:AddInputBegan({Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift}, function()
|
||||
ClientBindMap:AddInputBegan({Enum.KeyCode.LeftAlt, Enum.KeyCode.RightAlt}, function()
|
||||
HumanoidSettings:SetWalkSpeed(Walking)
|
||||
end)
|
||||
ClientBindMap:AddInputEnded({Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift}, function()
|
||||
ClientBindMap:AddInputEnded({Enum.KeyCode.LeftAlt, Enum.KeyCode.RightAlt}, function()
|
||||
HumanoidSettings:SetWalkSpeed(10)
|
||||
end)
|
||||
--Sprint
|
||||
ClientBindMap:AddInputBegan({Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift}, function()
|
||||
|
||||
end)
|
||||
ClientBindMap:AddInputEnded({Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift}, function()
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
local function Crosshair3DVelocity_Effect(): RBXScriptSignal
|
||||
|
||||
Reference in New Issue
Block a user