of     1   

CDDevelopment
#185572429Friday, March 18, 2016 10:27 AM GMT

so I have a problem, whenever a player in my game is idle and not moving they will fall through the ground a little and then pop back up repeatedly. This is a physics bug not a script error. I've decided to fix it by including a body velocity that takes off a large amount of the character's weight and to put it in their torso when they arent pressing any keys. That works however, my function for removing it does not work. Here are the two functions: function hover() if #game:GetService("UserInputService"):GetKeysPressed() == 0 then if Player.Character.Torso then script.BHov:Clone().Parent = Player.Character.Torso elseif not Player.Character.Torso then print("theres no torso here") end end end game:GetService("UserInputService").InputBegan:connect(function() if Player.Character.Torso then local l = Player.Character.Torso:GetChildren() for i=1, #l do if l.Name == "BHov" then l:Remove() end end elseif not Player.Character.Torso then print("theres no torso here") end end) game:GetService("UserInputService").InputEnded:connect(hover) I did try if keypressed >=1 then and i also tried if keyspressed ~= 0 but neither work.
CDDevelopment
#185572461Friday, March 18, 2016 10:29 AM GMT

bump
EllisLadon
#185574248Friday, March 18, 2016 12:24 PM GMT

you don't need that for loop in the torso, throw that out and replace it with local bhov = torso:FindFirstChild("BHov") if bhov then bhov:Destroy() end

    of     1