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: [Q] Why this animation wont work?

Previous Thread :: Next Thread 
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
15 Jul 2015 05:18 PM

Hello, i got a problem while scripting this:
//code
local preloader = game:GetService("ContentProvider")
local animations = {}
local sounds = {}
local Player = game.Players.LocalPlayer
local alrPlaying = false
local relTime = 2
for i = 1,#animations do
preloader:Preload("http://roblox.com/asset?id="..animations[i])
while preloader.RequestQueueSize > 0 do
wait()
end
print("Loaded Animation: "..i)
end

for i = 1,#sounds do
preloader:Preload("http://roblox.com/asset?id="..sounds[i])
while preloader.RequestQueueSize > 0 do
wait()
end
print("Loaded Sound: "..i)
end
local sound = Instance.new("Sound", Player.Character.Torso)
sound.Volume = 1

local check = Instance.new("BoolValue", Player.Character)
check.Name = "Dodge"
check.Value = false

for i ,v in pairs(Player.Character:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
v.Touched:connect(function()
if check.Value == true and alrPlaying == false then
alrPlaying = true
local anim = "http://roblox.com/asset?id="..animations[math.random(1,#animations)]
sound.SoundId = "http://roblox.com/asset?id="..sounds[math.random(1,#sounds)]

script.Anim.AnimationId = anim
print(anim)

local animPlr = Player.Character.Humanoid:LoadAnimation(script.Anim)
animPlr:Play()
sound:Play()
wait(relTime)
alrPlaying = false
check.Value = false
end
end)
end
end
//code

Yes i removed the animations beacause i don't want to leak them but, if you put any animation in it won't load (The sound plays doe) how do i fix it?
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
16 Jul 2015 04:20 AM
bump
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
16 Jul 2015 04:26 AM
Nevermind. Fixed it but how do you make the default animations(Walking, Running, Jump etc..) won't override the current animation?
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
16 Jul 2015 05:05 AM
Fixed.. Got no support. Nice thanks.
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