|
| 03 May 2017 07:18 PM |
In roblox studio, I made a animation but how do I make it so when you press c, the animation plays forever unless you press c again.
Basically, if you press C you start to crawl which is the animation. If you press C again you stand up and no longer crawl. How do I make it so you crawl forever unless you press C?
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:18 PM |
wait(2)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation
Mouse.KeyDown:connect(function(key) if key == "c" then s = player.Character.Humanoid:LoadAnimation(Anim) s:Play()
end end)
My script so far. Please help me!!!!
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:19 PM |
local varible = true
if variable = true then variable = false
your code here
return end
if variable = false then variable = true
your code here
return end |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:20 PM |
What do you mean by your code here?
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:21 PM |
Can you take this script and tell me where to put your script in it?
wait(2)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation
Mouse.KeyDown:connect(function(key) if key == "c" then s = player.Character.Humanoid:LoadAnimation(Anim) s:Play()
end end)
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:22 PM |
| He means to have a boolean variable to keep track of whether the player is in the crawl animation or not. When C is pressed, check that variable to know the condition of the player, then either play or stop the animation based on that condition. |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:22 PM |
local varible = true
--If the variable is true then it will change it to false, allowing it to switch if variable = true then variable = false
your code here
return end
--If the variable is false then it will change it true, allowing it to switch if variable = false then variable = true
your code here
return end |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:24 PM |
What code do I put where it says your code here?
|
|
|
| Report Abuse |
|
|
| |
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
| |
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
| |
|
|
| 03 May 2017 07:26 PM |
So let me get this right, should it look like this?
local varible = true
--If the variable is true then it will change it to false, allowing it to switch if variable = true then variable = false
wait(2)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation
Mouse.KeyDown:connect(function(key) if key == "c" then s = player.Character.Humanoid:LoadAnimation(Anim) s:Play()
end end)
return end
--If the variable is false then it will change it true, allowing it to switch if variable = false then variable = true
wait(2)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation
Mouse.KeyDown:connect(function(key) if key == "c" then s = player.Character.Humanoid:LoadAnimation(Anim) s:Play()
end end)
return end
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:28 PM |
| also after the if statements i forgot to put another equal sign |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:29 PM |
Can you do the script? Use this script
wait(2)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation
Mouse.KeyDown:connect(function(key) if key == "c" then s = player.Character.Humanoid:LoadAnimation(Anim) s:Play()
end end)
And put your script in it?
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:30 PM |
| ############################################################### |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 May 2017 07:30 PM |
| What they are telling you, is rather easy to follow if you understand basic programming. Since you do not, I'm assuming you don't. I'd suggest this article: ######################################################### I also suggest viewing the tutorials that are after |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 May 2017 07:31 PM |
| I love roblox. They censored a wiki.roblox.com article link: ######################################################### |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:31 PM |
1. Go to the roblox wiki 2. Go to the 'Humanoid' page and see what the 'LoadAnimation' function returns 3. Go to the page of the instance it returns and read |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 May 2017 07:32 PM |
What they are telling you, is rather easy to follow if you understand basic programming.
Since you do not, I'm assuming you don't.
I'd suggest this article: goo.gl/Nwm934
I also suggest viewing the tutorials that are after
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:33 PM |
Can someone just help me?
In roblox studio, I made a animation but how do I make it so when you press c, the animation plays forever unless you press c again.
Basically, if you press C you start to crawl which is the animation. If you press C again you stand up and no longer crawl. How do I make it so you crawl forever unless you press C?
|
|
|
| Report Abuse |
|
|
|
| 03 May 2017 07:34 PM |
I just need the SCRIPT thats all. Combine your script with mine.
|
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 May 2017 07:35 PM |
"I just need the SCRIPT"
Yes, you do need a script to run code in roblox. That isn't new
|
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 May 2017 07:36 PM |
Sorry, that was rude.
But check out the link I sent.
goo.gl/Nwm934
|
|
|
| Report Abuse |
|
|
12904
|
  |
| Joined: 29 Oct 2012 |
| Total Posts: 441 |
|
|
| 03 May 2017 08:26 PM |
| Here, Made this a while back. https://www.roblox.com/library/691378678/Sprint-Crouch-Tool |
|
|
| Report Abuse |
|
|
|
| 03 May 2017 09:37 PM |
You pasted your code, when it says "put your code here" You take the code you did and copy and paste yours where it shows. |
|
|
| Report Abuse |
|
|