Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Guys Quick Question, How do i make my humanoids HipHeight go up or down with the press of a button?

Asked by 4 years ago
Edited 4 years ago

its difficult to explain so umm but i dont want a animation to play when the hip height changes ill just put script but every time i remove the animation part of the script it doesn't work. Here is the script

local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character

UIS.InputBegan:connect(function(input)
 if input.KeyCode == Enum.KeyCode.LeftControl then
  Character.Humanoid.HipHeight = 11
  local Anim = Instance.new('Animation')
  Anim.AnimationId = 'rbxassetid://12345678910'
  PlayAnim = Character.Humanoid:LoadAnimation(Anim)
  PlayAnim:Play()
 end
end)

UIS.InputEnded:connect(function(input)
 if input.KeyCode == Enum.KeyCode.LeftControl then
  Character.Humanoid.HipHeight = 4.8
  PlayAnim:Stop()
 end
end)

Answer this question