generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Crouching Doesn't Work

Previous Thread :: Next Thread 
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
22 Jan 2013 02:53 PM
So, I looked over the original crouch script, went 'that's too inefficient', and made my own code. The legs function perfectly, but the character 'floats' in mid air. I can't figure out what's the problem.

NOTICE: The code is part of more code, so don't go '*facepalm* *writes out KeyDown code*'

if not debounce then
print(player.Name .. " is crouching.")
debounce = true
character.Torso:FindFirstChild("Right Hip").Part1 = nil; character.Torso:FindFirstChild("Left Hip").Part1 = nil
cweld = Instance.new("Weld", character.Torso); cweld2 = Instance.new("Weld", character.Torso)
cweld.Part0 = cweld.Parent; cweld2.Part0 = cweld.Parent
cweld.Part1 = character:FindFirstChild("Right Leg"); cweld2.Part1 = character:FindFirstChild("Left Leg")
cweld.C0 = CFrame.new(1.5, -0.5, 0.5)*CFrame.Angles(math.rad(10), 0, 1); cweld2.C0 = CFrame.new(-1.5, -0.5, 0.5)*CFrame.Angles(math.rad(10), 0, -1)
elseif debounce then
print(player.Name .. " has stopped crouching.")
debounce = false
cweld:Destroy(); cweld2:Destroy()
character.Torso:FindFirstChild("Right Hip").Part1 = character:FindFirstChild("Right Leg"); character.Torso:FindFirstChild("Left Hip").Part1 = character:FindFirstChild("Left Leg")
end

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
22 Jan 2013 02:55 PM
Try C1
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
22 Jan 2013 02:59 PM
@crouton04

Tested-- it just made the legs go to completely different locations. Thanks, though.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
22 Jan 2013 03:05 PM
Wait didn't read script are u using crame.angles
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
22 Jan 2013 03:07 PM
@crouton04

I am using CFrame.Angles.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
22 Jan 2013 05:13 PM
Bump.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
xNitrospeedx is not online. xNitrospeedx
Joined: 05 Sep 2011
Total Posts: 189
22 Jan 2013 06:56 PM
double bump
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
22 Jan 2013 08:31 PM
Bump.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
24 Jan 2013 06:37 PM
Bump.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
MainDirectory is not online. MainDirectory
Joined: 20 Dec 2012
Total Posts: 1834
24 Jan 2013 06:54 PM
I had the same problem a-while back, my friend DoogleFox said put body force, or one of the body objects, sorry I am not much help, but one of them, I forget which, and make the force, or velocity, whichever, pointing down. and it will work. :D
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
30 Jan 2013 12:22 PM
Finally solved it.

Just changing the names of the legs will make it function.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image