Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Im new to animations and my animations aren't playing?

Asked by
CjayPlyz 643 Moderation Voter
4 years ago
Edited 4 years ago
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local tool = script.Parent

local function Activated ()
    player.Character.Humanoid:LoadAnimation(tool.Equip)
    player.Character.Humanoid:LoadAnimation(tool.Idle)
    local target = mouse.Target
    if target then
        local remoteevent = target:FindFirstChild("RemoteEvent")
        if remoteevent then
            remoteevent:FireServer()
        end
    end
end

local function Deactivated ()
    player.Character.Humanoid:LoadAnimation(tool.Unequip)
end

tool.Activated:Connect(Activated)
tool.Deactivated:Connect(Deactivated)

There's no errors, all animations are placed in the tool like they should be. How I made my animations: I have a tool and placed the handle of it inside an r15 block rig, and used tool grip (plugin) to align it, then used custom character creator (plugin) to bind the handle to the right hand. after that I made the animations and saved it to roblox. Then I inserted animation (object) to the tool and edited the animationid.

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

To make animations, you have to insert an animation into the script with the ID as it's value, and reference it in the script like this.

local animation = script.Animation

local AnimationTrack = Humanoid:LoadAnimation(Animation) --- You need to load the animation, so you do this.

AnimationTrack:Play() --- playing the animation.

Also you should just set a variable for humanoid instead of doing Player.Character.Humanoid

Ad

Answer this question