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 » Scripters
Home Search
 

Re: Please Read! Roblox Studio

Previous Thread :: Next Thread 
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
EpicWalnut5 is not online. EpicWalnut5
Joined: 08 Aug 2014
Total Posts: 5104
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
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
03 May 2017 07:20 PM
What do you mean by your code here?


Report Abuse
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
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
EpicWalnut5 is not online. EpicWalnut5
Joined: 08 Aug 2014
Total Posts: 5104
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
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
03 May 2017 07:24 PM
What code do I put where it says your code here?


Report Abuse
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
03 May 2017 07:25 PM
Scripting code?


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
03 May 2017 07:25 PM
your code


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
03 May 2017 07:25 PM
"Scripting code"

wat

yes


Report Abuse
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
EpicWalnut5 is not online. EpicWalnut5
Joined: 08 Aug 2014
Total Posts: 5104
03 May 2017 07:28 PM
also after the if statements i forgot to put another equal sign
Report Abuse
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
03 May 2017 07:30 PM
###############################################################
Report Abuse
caca50 is not online. 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 is not online. 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
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
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 is not online. 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
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
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
Sheepguest321 is online. Sheepguest321
Joined: 01 Jul 2014
Total Posts: 245
03 May 2017 07:34 PM
I just need the SCRIPT thats all. Combine your script with mine.


Report Abuse
caca50 is not online. 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 is not online. 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 is online. 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
LegomasterNiko is not online. LegomasterNiko
Joined: 27 Feb 2013
Total Posts: 1176
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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