You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to fix the crouch issue
What is the issue? Include screenshots / videos if possible!
Whenever i equip an gun tool or any tool when crouching
its like floating up
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to change the animation nothing work
here a screenshot of when i equip an tool
here screenshot of normal crouch
local module = {}
local Player = game:GetService("Players").LocalPlayer
local Values = Player:WaitForChild("Values")
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("CROUCH")
local Animations = script:WaitForChild("Animations")
local Crouch = false
local Walking = true
local PlayingWalk = false
local AnimationsTracks = {}
module.Crouch = function (self)
Crouch = not Crouch
if Crouch then
AnimationsTracks["Idle"] = Humanoid:LoadAnimation(Animations:WaitForChild("Crouch"))
AnimationsTracks["Idle"].Priority = Enum.AnimationPriority.Idle
if AnimationsTracks["Idle"] then
AnimationsTracks["Idle"]:Play()
Remote:FireServer()
end
RunService.RenderStepped:Connect(function()
if Crouch then
local MoveDirection = Humanoid.MoveDirection
if MoveDirection.Magnitude > 0 then
Walking = true
else
Walking = false
end
end
end)
else
if AnimationsTracks["Idle"] then
AnimationsTracks["Idle"]:Stop()
Remote:FireServer()
end
end
end
module.Init = function ()
local self = setmetatable({}, {
__index = module
})
UserInputService.InputBegan:Connect(function(Input, processed)
if processed then
return
end
if Input.KeyCode == Enum.KeyCode.C then
self:Crouch()
end
end)
return self
end
module.Init()
Im gonna need a new person to help me that it
this is just an true example of how devforum people arent really helpful and just yapping
if ure not scripter then dont reply to my post and that it
yes i did thank you for ur time and for u trying to help me
but this do not help me afterall
and this script is outdated and is no longer working
so its was script issue afterall no the animation
and its the same topic i did and it doesnt help me anymore
local Player = game:GetService(“Players”).LocalPlayer
local Values = Player:WaitForChild(“Values”)
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass(“Humanoid”)
local RunService = game:GetService(“RunService”)
local UserInputService = game:GetService(“UserInputService”)
local Remote = game:GetService(“ReplicatedStorage”):WaitForChild(“Remotes”):WaitForChild(“CROUCH”)
local Animations = script:WaitForChild(“Animations”)
local Crouch = false
local Walking = true
local PlayingWalk = false
local AnimationsTracks = {}
module.Crouch = function (self)
Crouch = not Crouch
if Crouch then
AnimationsTracks[“Idle”] = Humanoid:LoadAnimation(Animations:WaitForChild(“Crouch”))
AnimationsTracks["Idle"].Priority = Enum.AnimationPriority.Idle
if AnimationsTracks["Idle"] then
AnimationsTracks["Idle"]:Play()
Remote:FireServer()
end
RunService.RenderStepped:Connect(function()
if Crouch then
local MoveDirection = Humanoid.MoveDirection
if MoveDirection.Magnitude > 0 then
Walking = true
else
Walking = false
end
end
end)
else
if AnimationsTracks[“Idle”] then
AnimationsTracks[“Idle”]:Stop()
Remote:FireServer()
end
end
end
module.Init = function ()
local self = setmetatable({}, {
__index = module
})
UserInputService.InputBegan:Connect(function(Input, processed)
if processed then
return
end
if Input.KeyCode == Enum.KeyCode.C then
self:Crouch()
end
end)
return self
end
module.Init()
then can u tell me if this script really outdated or no? which its was from jan 29
this wasnt animation crouch fault or the tools yes i understand what u meant
this is the script that he gave me in jan 29 2024
and it work but now this script is outdated and which why i made new post
local TweenService = game:GetService(“TweenService”)
local Humanoid = game:GetService(“Players”).LocalPlayer.Character:WaitForChild(“Humanoid”)
local HumanoidRootPart = game:GetService(“Players”).LocalPlayer.Character:WaitForChild(“HumanoidRootPart”)
local CrouchAnimation = script.CrouchAnimation
local CrouchTrack = Humanoid:LoadAnimation(CrouchAnimation)
hey ik this is no related to the topic that i open but
i was just looking around for new crouch system in yt tutorial
can u help me how to prevent pressing C to crouch while typing in roblox chat?
local UI = game:GetService("UserInputService")
local Humanoid = script.Parent:WaitForChild("Humanoid")
local Animation = Humanoid:LoadAnimation(script:WaitForChild("Animation"))
local Run = false
UI.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.C then -- C is what key to crouch
if not Run then
Run = true
Animation:Play()
Humanoid.WalkSpeed = 8 -- Slow walkspeed cuz crouching
else
Animation:Stop()
Run = false
Humanoid.WalkSpeed = 16 -- Normal walkspeed
end
end
end)
you can also lower down the hip height whenever the tool is added while crouching to minimize the effect of floating in the air , however i definitielly recommend you the first solution i gave you and changing just the hip height could create more issues when the torso wasnt just added as a keyframe but was actually moving
maybe try this: ( i added istyping check ) ( and i put hipheight to make the first person player look like their crouching u can adjust to what u want, just dont change the hipheight = 2, only 1
local UI = game:GetService("UserInputService")
local Humanoid = script.Parent:WaitForChild("Humanoid")
local Animation = Humanoid:LoadAnimation(script:WaitForChild("Animation"))
local Run = false
UI.InputBegan:Connect(function(key, processed)
if not UI:IsTyping() then
if key.KeyCode == Enum.KeyCode.C then
if not Run then
Run = true
Animation:Play()
Humanoid.WalkSpeed = 8
Humanoid.HipHeight = 1
else
Animation:Stop()
Run = false
Humanoid.WalkSpeed = 16
Humanoid.HipHeight = 2
end
end
end
end)