mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
43 lines
1.7 KiB
Lua
43 lines
1.7 KiB
Lua
local Storage = game:GetService("ReplicatedStorage")
|
|
local ClientStorage = Storage:WaitForChild("Client")
|
|
|
|
local LoadCompleted = ClientStorage:WaitForChild("LoadingComplete")
|
|
|
|
--We need to wait for the game to load before spamming functionality
|
|
repeat
|
|
local GameIsLoaded = LoadCompleted:Invoke()
|
|
task.wait()
|
|
until GameIsLoaded
|
|
|
|
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")
|
|
local Humanoid = Character:WaitForChild("Humanoid")
|
|
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()
|
|
|
|
CrouchFeature() |