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: Does anyone have a WORKING crouch script for gun tool?

Previous Thread :: Next Thread 
gahou is not online. gahou
Joined: 12 Oct 2009
Total Posts: 2261
14 Aug 2014 10:51 PM
If only roblox didn't break mine..
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 10:55 PM
No, sorry.
Report Abuse
gahou is not online. gahou
Joined: 12 Oct 2009
Total Posts: 2261
14 Aug 2014 10:56 PM
What do you mean? Are they impossible to make... O.e
Report Abuse
barnslig101 is not online. barnslig101
Joined: 29 Aug 2008
Total Posts: 3225
14 Aug 2014 10:56 PM
Free models does.
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 10:59 PM
Sorta. I guess you could cheat and squish the person into the ground (tweak the force a bit, it might push them a little TOO much...)

local cr;

game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
if key=="x" and not cr then
cr=cr==false and true or false
Instance.new("BodyForce",game.Players.LocalPlayer.Character.Torso).force=Vector3.new(0,-200,0)
else
gmae.Players.LocalPlayer.Character.Torso["BodyForce"]:Destroy()
end
end)
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 11:00 PM
^^^^ 3rd to last line:
game.Players.LocalPlayer.Character.Torso["BodyForce"]:Destroy()
Corrected it b/c of spelling error
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
14 Aug 2014 11:00 PM
this is one I made using CLerp (no, I'm nto going to break all the variabled down for you, sorry. you'll have to figure that out yourself =/)


function CLerp(C1, C2, Speed)
local Comp1 = {C1.X, C1.Y, C1.Z, C1:toEulerAnglesXYZ()};
local Comp2 = {C2.X, C2.Y, C2.Z, C2:toEulerAnglesXYZ()};
for num, accel in pairs(Comp1) do
Comp1[num] = Return(accel, Comp2[num], Speed);
end
return CFrame.new(Comp1[1], Comp1[2], Comp1[3]) * CFrame.Angles(select(4,unpack(Comp1)));
end

--in a loop:


if _G.crouching == true then
if _G.ItemGun1Equipped == true then
_G.RightArm = CFrame.new(1.5,0.5,-0.1) * CFrame.Angles(1.57 + -math.pi/18 + math.sin(Anim)/1 * 0.15,0,0);
_G.LeftArm = CFrame.new(0.5,0.2,-1.45) * CFrame.Angles(1.57 + -math.pi/18 + math.sin(Anim)/1 * 0.1,0,0.4);
elseif _G.ItemGun2Equipped == true then
_G.RightArm = CFrame.new(0.7,0.2,-1) * CFrame.Angles(1.2,0,-0.6);
_G.LeftArm = CFrame.new(0.1,0.2,-0.95) * CFrame.Angles(1.2,0,0);
end
_G.RightLeg = CFrame.new(0.5,-0.2,-0.5) * CFrame.Angles(-0.2 + math.sin(Anim) * 0.1,0,0);
_G.LeftLeg = CFrame.new(-0.5,-0.2,-0.5) * CFrame.Angles(-0.2 + -math.sin(Anim) * 0.2,0,0);
_G.RootPart = CFrame.new(0,-1,0) * CFrame.Angles(0,math.rad(math.sin(Anim)/1) * 1,0,0);
end
Motor1.C0 = CLerp(Motor1.C0, _G.RightArm, NewSpeed);
Motor2.C0 = CLerp(Motor2.C0, _G.LeftArm, NewSpeed);
Motor3.C0 = CLerp(Motor3.C0, _G.RightLeg, NewSpeed);
Motor4.C0 = CLerp(Motor4.C0, _G.LeftLeg, NewSpeed);
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
14 Aug 2014 11:03 PM
I forgot the Return function.


function Return(Alpha, Bravo, Charlie)
return Alpha + (Bravo - Alpha) * Charlie;
end
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 11:03 PM
ogm hax mush leet retern funktin!

_____________________________________
BinaryStringValues4Life
Report Abuse
gahou is not online. gahou
Joined: 12 Oct 2009
Total Posts: 2261
14 Aug 2014 11:06 PM
Oh wow such code, little understanding.

I found a working crouch and prone script, but it stands you up after using the tool (Firing a gun)

Workaround for this?
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 11:09 PM
Hopefully the script's inside of a tool already; if it is, just parent the script under the gun.
Report Abuse
gahou is not online. gahou
Joined: 12 Oct 2009
Total Posts: 2261
14 Aug 2014 11:09 PM
It's one of those startergui crouch scripts :/
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
14 Aug 2014 11:12 PM
Idk then, sorry. I'm bad w/ freemodels.
Report Abuse
gahou is not online. gahou
Joined: 12 Oct 2009
Total Posts: 2261
14 Aug 2014 11:14 PM
This is it, could you have a look please? http://www.roblox.com/Crouch-Script-Body-Package-Compatible-14-05-04-item?id=145244822

I'd use yours or acomplishables but I wouldn't know how to get them to work.
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