I’m trying to change default animations when a tool is activated for a certain amount of time.
The code changes the animid to desired animationid and it plays on both client and server.
But when I try to change the animid back to roblox default animationid it changes the id on both screens but only works on client screen.
--module script function in serverscriptservice for toolfunctions
local humalive = true
local function onDied()
humalive = false
end
oldCharacter:FindFirstChildWhichIsA("Humanoid").Died:Connect(onDied)
oldCharacter = player.Character
oldCharacter.Animate.idle.Animation1.AnimationId = config["IdleAnimation"]
oldCharacter.Animate.walk.WalkAnim.AnimationId = config["WalkAnimation"]
replicatedStorage.ClientRemotes.ChangeState:FireClient(player)
task.delay(tool.Cooldown2.Value, function()
if humalive then
print("oldcharacter found.")
oldCharacter.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=180435571"
oldCharacter.Animate.walk.WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=180426354"
replicatedStorage.ClientRemotes.ChangeState:FireClient(player)
end
end)
--Config module script in serverscriptservice
local Genetics = {["Crimson Eclipse Infusion"] = {
["IdleAnimation"] = "rbxassetid://13531672948",
["WalkAnimation"] = "rbxassetid://13531672132"
}}
--changestate local script
game:GetService("ReplicatedStorage").ClientRemotes.ChangeState.OnClientEvent:Connect(function()
game:GetService("Players").LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):ChangeState(Enum.HumanoidStateType.Landed)
end)
video: client and server as you can see animation does not stop on server