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: Making accurate footstep sound script for animations, help!

Previous Thread :: Next Thread 
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 08:50 AM
Why isn't the sound playing when the keyframe reaches footstep1 or 2?

local player = game.Players.LocalPlayer
local character = game.Workspace:WaitForChild(player.Name)
local humanoid = character:WaitForChild("Humanoid")
local sound = script:WaitForChild("FootstepSound")
local AnimationTrack = humanoid:LoadAnimation(script.Parent)
AnimationTrack.KeyframeReached:Connect(function(name)

if name == "FootStep1" then
sound:Play()
end
end)


AnimationTrack.KeyframeReached:Connect(function(name)
if name == "FootStep2" then
sound:Play()
end
end)

Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 08:55 AM
The parent of this LocalScript is an animation. Let me correct myself, FootStep1 and FootStep # ################ ######### in an animation. so the question is................ why isn't the sound playing each time the animation reaches those keyframes?
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
16 Jul 2017 08:56 AM
are you sure you named your keyframes correctly? try adding in print(name) to see if it even triggers or the keyframes are named differently


Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
16 Jul 2017 08:59 AM
You have a small redundancy in your script. You connect ################ ######### ## ############### when you only need one. Remove the second KeyframeReached event and add an elseif to the first one
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 10:24 AM
The names are correct for sure and turn the code into an elseif statement didn't solve anything.

I'm not sure on how to do this, I looked at the example on the wiki, but I do not know where the keyframes for the animation are so I can direct the script to them.
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 10:34 AM
This outta be as accurate as footsteps get, common guys, help me out here! This can;t get done without the help of you guys!!! Now is the time!! Sisters, brothers, RISE!
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 10:37 AM
*CMON' MY COMRADES!
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 10:55 AM
Will no one else help me?
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 10:59 AM
Nobody wants accurate footsteps?!
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:16 AM
bump. cmon yall i need help.
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:19 AM
bump 1, The parent of the local script is the animation.
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:31 AM
bump 2
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:37 AM
omg cmon, ive been waiting 3 and 1/2 hrs for an answer.
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:48 AM
make that 4hrs
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 12:01 PM
bump 3
Report Abuse
Vultorz is not online. Vultorz
Joined: 02 Mar 2015
Total Posts: 2985
16 Jul 2017 12:01 PM
I feel so bad... I want to help but I'm not sure how to do this.


i like coconuts
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
16 Jul 2017 12:20 PM
put a print(name) to see if the names are correct and to see if it's even triggering
if it prints the names correctly, then the sound is either not loaded, not entered or very quiet


Report Abuse
maxsmurf is not online. maxsmurf
Joined: 07 Mar 2011
Total Posts: 718
16 Jul 2017 12:22 PM
Q: Where are your (LocalScript) and your (Animations) into? ex: Workspace, ServerScriptStorage...

I think by inserting a loop it will work.

local Player = game.Players.LocalPlayer
local Character = workspace:WaitForChild(Player.Name)
local Humanoid = Character:WaitForChild("Humanoid")
local Sound = script:WaitForChild("FootstepSound")
local AnimationTrack = Humanoid:LoadAnimation(script.Parent)

while true do
wait()
AnimationTrack.KeyframeReached:connect(function(name)
if name == "FootStep1" then
Sound:Play()
elseif name == "FootStep2" then
Sound:Play()
end
end)
end

Tell me how it goes! I apologize if it isn't working, I'm not really an advanced scripter!:D
( ͡° ͜ʖ ͡°) maxsmurf ( ͡° ͜ʖ ͡°)
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
16 Jul 2017 11:51 PM
I need more help guys, these solutions aren't working.


This has been going on for 9 hrs now...
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
16 Jul 2017 11:57 PM
are you even listening to borsy

tell us if it's printing out
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
17 Jul 2017 12:07 AM
The print() functions under the if then statements don't print at all.
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
17 Jul 2017 12:48 AM
This is crazy, i've been waiting 11 hrs to find out what exactly my mistake is. Can someone help me please?!
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
17 Jul 2017 12:55 AM
AnimationTrack.KeyframeReached:Connect(function(name)
print(name)

put a print like that right there and tell me what it says
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
17 Jul 2017 01:01 AM
I already said the event is not triggering, I have made prints, multiple times already on this script, as I said before the prints to not print at all. The events do not trigger and I don't know why.

Everyone out there, please help!
Report Abuse
JoeRaptorisBack is not online. JoeRaptorisBack
Joined: 03 Apr 2017
Total Posts: 287
17 Jul 2017 01:19 AM
bump 5

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