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: Hotkey B-Ball "Guard" Script Help

Previous Thread :: Next Thread 
BuildingDude000 is not online. BuildingDude000
Joined: 05 Jul 2009
Total Posts: 1340
16 Aug 2014 10:55 AM
I tried to re-script a crouch script that allows you to crouch by pressing a letter on the keyboard and I was trying to see if I could re-do the script to make you do a guarding stance like in basketball instead of crouch because both scripts had similarities.

Link to Guard Tool:
Link to Crouch Hotkey Script:

Here's the script that I tried to re-do.
_________________________________________________
on = 0
Tool = script.Parent
welds = {}
sh = {}
arms = nil
torso = nil
function Guard(ison)
if arms == nil and torso == nil then
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
if ison == 1 then
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(1, 1.3, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, math.rad(75))
welds[1] = weld1
-------------------------------------------
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1.2, 1.3, -0.2) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(-15), -20)
welds[2] = weld2
--
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
elseif ison == 0 then
if arms then
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
f.Parent = nil
arms[2].Name = "Right Leg"
arms[1].Name = "Left Leg"
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end

end
end

end
else
print("sh")
end
else
print("arms")
end
end
function Key(key)
if key then
key = string.lower(key)
if (key=="c") then
if on == 1 then
on = 0
elseif on == 0 then
on = 1
end
Guard(on)
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)
Report Abuse
BuildingDude000 is not online. BuildingDude000
Joined: 05 Jul 2009
Total Posts: 1340
16 Aug 2014 10:56 AM
Woops forgot the links

:Guard tool: http://www.roblox.com/Guard-pick-and-dive-tool-item?id=163048603

:crouch hotkey: http://www.roblox.com/Crouch-Script-Put-IN-your-weapon-item?id=83920180
Report Abuse
BuildingDude000 is not online. BuildingDude000
Joined: 05 Jul 2009
Total Posts: 1340
16 Aug 2014 11:04 AM
bump
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