Ladder contacts

This commit is contained in:
2024-02-22 14:14:16 -05:00
parent 92743349e5
commit 75a476c37a
5 changed files with 44 additions and 28 deletions

View 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

View File

@@ -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

View File

@@ -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