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: Stopping the animation.

Previous Thread :: Next Thread 
IIScript_ing is not online. IIScript_ing
Joined: 08 Apr 2017
Total Posts: 57
19 Nov 2017 04:46 PM
Hi guys. This is my script for a moving NPC. Its just the animation doesnt stop. could you add onto this script and reply with the same script just with the animation stopping after he walks the distance? Here is the script: local Npc = script.Parent local human = script.parent:FindFirstChild("Humanoid") local animation = Instance.new("Animation") animation.AnimationId = ########################################### local anim1 = human:LoadAnimation(animation) local distance = 0.5 local walkspeed = .003 Npc.PrimaryPart = Npc:WaitForChild("UpperTorso") anim1:Play() for i = .005, distance, walkspeed do wait(.01) Npc:SetPrimaryPartCFrame(Npc:GetPrimaryPartCFrame() * CFrame.new(0,0,-i)) end
Report Abuse
IIScript_ing is not online. IIScript_ing
Joined: 08 Apr 2017
Total Posts: 57
19 Nov 2017 04:47 PM
the local Npc = script.Parent local human = script.parent:FindFirstChild("Humanoid") local animation = Instance.new("Animation") animation.AnimationId = ################################# local anim1 = human:LoadAnimation(animation) local distance = 0.5 local walkspeed = .003 Npc.PrimaryPart = Npc:WaitForChild("UpperTorso") anim1:Play() for i = .005, distance, walkspeed do wait(.01) Npc:SetPrimaryPartCFrame(Npc:GetPrimaryPartCFrame() * CFrame.new(0,0,-i)) end
Report Abuse
dialza is not online. dialza
Joined: 12 Mar 2016
Total Posts: 211
19 Nov 2017 04:48 PM
anim1:Stop() should stop it


~my replies might be slow due to the posting cooldown but pm me if you want further elaboration
Report Abuse
IIScript_ing is not online. IIScript_ing
Joined: 08 Apr 2017
Total Posts: 57
19 Nov 2017 04:57 PM
When i do that the NPC just walks without the animation
Report Abuse
dialza is not online. dialza
Joined: 12 Mar 2016
Total Posts: 211
19 Nov 2017 04:59 PM
make sure anim1:Play() runs when walking, and anim1:Stop() runs when not walking


~my replies might be slow due to the posting cooldown. PM me if you want further elaboration as i may abandon threads
Report Abuse
IIScript_ing is not online. IIScript_ing
Joined: 08 Apr 2017
Total Posts: 57
19 Nov 2017 05:01 PM
ok could you copy my script and put those things into it cuz idk what you mean
Report Abuse
dialza is not online. dialza
Joined: 12 Mar 2016
Total Posts: 211
19 Nov 2017 05:03 PM
add something that checks whether the player is walking, then make a line of code to play and stop the animation based on that
i can't really add it myself because i can't tell what's going on in that it's messy


~my replies might be slow due to the posting cooldown. PM me if you want further elaboration as i may abandon threads
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