|
| 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 |
|
| |
|
| 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 |
|
|
| 16 Jul 2015 05:05 AM |
| Fixed.. Got no support. Nice thanks. |
|
|
| Report Abuse |
|