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
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()
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.