| |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 06:25 PM |
uis.inputbeggined { if input.key == c or input.key == left control then crouch the character model() end } |
|
|
| Report Abuse |
|
|
| |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 06:30 PM |
| should work. make it a modulescript in replicatedfirst. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 06:34 PM |
still didnt work
im new to scripting
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 06:35 PM |
You should try to learn more basic concepts before trying to tackle something like this. Start at the wiki:
wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 06:42 PM |
game:service'UserInputService'.InputBegan:connect(function(i,g) if not g then if i.UserInputType == Enum.UserInputType.Keyboard then if i.KeyCode == Enum.KeyCode.C then --Make them crouch end end end end)
There, I just did the hard part for you. Not that any of it is hard. Just use a BodyForce to push them down, disable it while jumping, then reenable it .75 seconds later or so. Then animate it with ROBLOX animations.
#code print("While I may look like a cataclysmic god of the eggs from the future, I am not.") |
|
|
| Report Abuse |
|
|
ImDgilly
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 76 |
|
|
| 20 Jul 2016 06:58 PM |
local UserInputService = game:GetService('UserInputService')
UserInputService.InputBegan:connect(function(Input, gameProcessed)
if Input.KeyCode == Enum.KeyCode.Z then
~~~ Crouch stuff here
end
end) |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 07:00 PM |
Eww that ugly white-space in the middle though Dgilly, and you forgot to make sure the input type matched. Now I have to rewrite my crap just to beat you.
#code game:GetService("UserInputService").InputBegan:connect(function(InputObject, GameProcessedEvent) if (not GameProcessedEvent) then if (InputObject.UserInputType == Enum.UserInputType.Keyboard) then if (InputObject.KeyCode == Enum.KeyCode.C) then --Code to crouch ere end end end end) Same advice for crouching applies, OP. Might be a little hard to follow at first, but you'll get there.
#code print("While I may look like a cataclysmic god of the eggs from the future, I am not.") |
|
|
| Report Abuse |
|
|