mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 21:51:55 +00:00
crouching and move Humanoid.lua from server to client
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
local Storage = game:GetService("ReplicatedStorage")
|
||||
local ClientStorage = Storage:WaitForChild("Client")
|
||||
|
||||
local HumanoidRPSettings = require(script:WaitForChild("HumanoidRootPart"))
|
||||
local CameraModule = require(script:WaitForChild("Camera"))
|
||||
local CrouchModule = require(script:WaitForChild("Crouch"))
|
||||
local BindModule = require(ClientStorage:WaitForChild("KeyBinds"))
|
||||
local HumanoidModule = require(script:WaitForChild("Humanoid"))
|
||||
|
||||
local Character = script.Parent
|
||||
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
|
||||
@@ -8,6 +14,22 @@ local CurrentCamera = workspace.CurrentCamera
|
||||
|
||||
local HRPSettings = HumanoidRPSettings.constructor(HumanoidRootPart)
|
||||
local CameraConsturctor = CameraModule.constructor(CurrentCamera, HumanoidRootPart, Humanoid)
|
||||
local HumanoidSettings = HumanoidModule.constructor(Humanoid)
|
||||
|
||||
local function CrouchFeature()
|
||||
local CrouchConstructor = CrouchModule.constructor(Humanoid)
|
||||
local CourchBindMap = BindModule.constructor()
|
||||
|
||||
CourchBindMap:AddInputBegan({Enum.KeyCode.RightControl, Enum.KeyCode.LeftControl}, function()
|
||||
CrouchConstructor:Crouch(10)
|
||||
end)
|
||||
CourchBindMap:AddInputEnded({Enum.KeyCode.RightControl, Enum.KeyCode.LeftControl}, function()
|
||||
CrouchConstructor:Stand(5)
|
||||
end)
|
||||
end
|
||||
|
||||
HumanoidSettings:SetWalkSpeed(10)
|
||||
HRPSettings:DisableRobloxSounds()
|
||||
CameraConsturctor:EnableBobbing()
|
||||
CameraConsturctor:EnableBobbing()
|
||||
|
||||
CrouchFeature()
|
||||
Reference in New Issue
Block a user