eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 12:44 PM |
Is there any way to change default animations mid-game while animations started? I thought it was just as easy as changing the id in the Animate (exmp: Animate -> walk -> WalkAnim) but that doesn't change anything.
Did they update it?
|
|
|
| Report Abuse |
|
|
iiNemo
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 2380 |
|
|
| 26 Nov 2017 12:47 PM |
delete the current animation script in the player and insert a new one edited with your ids.
Fish Are Friends, Not Food |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 12:50 PM |
do i have to do that everytime i edit want a new id? like for changing animations mid-game
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 12:52 PM |
wait it started working... brb
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 01:00 PM |
nvm false alarrrrmmmmm sry :3
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 01:14 PM |
ok 1 more question, how would i efficiently switch animation because when i change it freezes until i stop and walk again
local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:wait() local Humanoid = Character:WaitForChild("Humanoid")
local Animate = Character:WaitForChild("Animate") local WalkAnim = Animate:WaitForChild("walk"):WaitForChild("WalkAnim") local RunAnim = Animate:WaitForChild("run"):WaitForChild("RunAnim") local IdleAnim1 = Animate:WaitForChild("idle"):WaitForChild("Animation1") local IdleAnim2 = Animate:WaitForChild("idle"):WaitForChild("Animation1")
local AnimationList = { WalkAnimationId = "[blocked by filter]", SprintAnimationId = "[blocked by filter]", }
local function ReplaceAnimation(OldAnim, newAnimId, AnimationName) OldAnim.AnimationId = newAnimId -- print('Changing '.. OldAnim.Name .. ' to ' .. AnimationName) wait(0.1) for _,oldPlayingAnimation in pairs(Humanoid:GetPlayingAnimationTracks()) do print(oldPlayingAnimation.Name) oldPlayingAnimation:Stop() end end
game:GetService("RunService").RenderStepped:connect(function() if Character:FindFirstChild("ShiftSpeedBoost") then --if Sprinting if RunAnim.AnimationId ~= AnimationList.SprintAnimationId then ReplaceAnimation(RunAnim, AnimationList.SprintAnimationId, "Sprint") ReplaceAnimation(WalkAnim, AnimationList.SprintAnimationId, "Sprint") end else --If not sprinting if tostring(RunAnim.AnimationId) ~= tostring(AnimationList.WalkAnimationId) then ReplaceAnimation(RunAnim, AnimationList.WalkAnimationId, "DefaultWalk") ReplaceAnimation(WalkAnim, AnimationList.WalkAnimationId, "DefaultWalk") end end end)
game:GetService("UserInputService").InputEnded:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent == true then return end if inputObject.UserInputType == Enum.UserInputType.Keyboard then if inputObject.KeyCode == Enum.KeyCode.One then if Character:FindFirstChild("ShiftSpeedBoost") then Character:FindFirstChild("ShiftSpeedBoost"):Destroy() else local newObj = Instance.new("ObjectValue", Character) newObj.Name = "ShiftSpeedBoost" end end end end)
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 01:20 PM |
btw this is a local script in startercharacterscripts
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
iiNemo
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 2380 |
|
|
| 26 Nov 2017 01:51 PM |
I explained to you the quickest and simplest method of doing it..
Fish Are Friends, Not Food |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 04:24 PM |
still freezes
local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:wait()
local AnimateScript = script:WaitForChild("Animate")
local AnimationList = { WalkAnimation = "rbxassetid://" .. 12########### SprintAnimation = "rbxassetid://" ..##2########### -###obbyWalkAnim = "rbxassetid://" .. 54##############obbyIdleAnim1 = "rbxassetid://" ..##0##########--##obbyIdleAnim2 = "rbxassetid://" .. 50##########}
local function ReplaceAnimation(Animation, AnimationParent, newAnimId, replaceScript) AnimateScript:WaitForChild(AnimationParent.Name):WaitForChild(Animation.Name).AnimationId = newAnimId print('Changing '.. Animation.Name .. ' to ' .. newAnimId) if re#############=##rue then local oldAnim = Character:WaitForChild("Animate") oldAnim:Destroy() local newAnim = AnimateScript:Clone() newAnim.Parent = Character newAnim.Disabled = false print('Script replaced') end end
game:GetService("UserInputService").InputEnded:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent == true then return end if inputObject.UserInputType == Enum.UserInputType.Keyboard then if inputObject.KeyCode == Enum.KeyCode.One then if Character:FindFirstChild("ShiftSpeedBoost") then Character:FindFirstChild("ShiftSpeedBoost"):Destroy() else local newObj = Instance.new("ObjectValue", Character) newObj.Name = "ShiftSpeedBoost" end end end end)
while wait(0.5) do if Character:FindFirstChild("Animate") then local oldAnimate = Character:WaitForChild("Animate") local WalkAnim = oldAnimate:WaitForChild("walk"):WaitForChild("WalkAnim") local RunAnim = oldAnimate:WaitForChild("run"):WaitForChild("RunAnim") if Character:FindFirstChild("ShiftSpeedBoost") then --if Sprinting if tostring(RunAnim.AnimationId) ~= tostring(AnimationList.SprintAnimation) then ReplaceAnimation(RunAnim, RunAnim.Parent, AnimationList.SprintAnimation) ReplaceAnimation(WalkAnim, WalkAnim.Parent, AnimationList.SprintAnimation, true) end else --If not sprinting if tostring(RunAnim.AnimationId) ~= tostring(AnimationList.WalkAnimation) then ReplaceAnimation(RunAnim, RunAnim.Parent, AnimationList.WalkAnimation) ReplaceAnimation(WalkAnim, WalkAnim.Parent, AnimationList.WalkAnimation, true) end end end end
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Nov 2017 04:28 PM |
well its not frozen but it plays idle until i like stop/jump/etc, if i walk while switching it does idle
|
|
|
| Report Abuse |
|
|