Hello Everyone!
I have been making a custom Tool System for one of my new Roblox Games, but it does not seem to work in the Client, but kind of works on the Server.
Code for creating a Tool and the animation:
--============================================
--// MODULES
local TOOL_DATA = require(script.Tool_Data);
--============================================
--// Variables
local TOOL_MODELS = script.Models;
--============================================
--// SETTINGS
local Animations = {
Hold_Animation = "rbxassetid://92949079562954";
}
local BSG_Tool = {}
-- Module Script (Inside Replicated Storage)
--//
--[[
]]
function BSG_Tool.Create_Tool(Player: Player, Tool: string): ()
local NEW_TOOL_MODEL: Model = TOOL_MODELS[Tool]:Clone();
if not NEW_TOOL_MODEL then return end;
-- Initiate Variables
local GIVEN_TOOL_DATA = TOOL_DATA[Tool];
local PLAYER_CHARACTER = (Player.Character or Player.CharacterAdded:Wait());
if not PLAYER_CHARACTER:FindFirstChildOfClass("Humanoid") then return end;
local PLAYER_RIGHT_HAND: BasePart = PLAYER_CHARACTER.RightHand;
local PLAYER_ANIMATOR = PLAYER_CHARACTER:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator");
-- Return if Player Animator does not exist.
if not PLAYER_ANIMATOR then return end;
local MOTOR_6D = Instance.new("Motor6D");
local NEW_ANIMATION = Instance.new("Animation");
local ANIMATION_TRACK: AnimationTrack = nil;
MOTOR_6D.Part0 = PLAYER_RIGHT_HAND;
MOTOR_6D.C0 = GIVEN_TOOL_DATA.Offset_CFrame;
NEW_ANIMATION.Name = "Hold_Animation";
NEW_TOOL_MODEL:PivotTo(PLAYER_RIGHT_HAND.RightGripAttachment.WorldCFrame);
MOTOR_6D.Part1 = NEW_TOOL_MODEL.Handle;
MOTOR_6D.Parent = NEW_TOOL_MODEL.Handle;
NEW_ANIMATION.AnimationId = Animations[NEW_ANIMATION.Name];
NEW_ANIMATION.Parent = NEW_TOOL_MODEL; -- Put newly made Tool into the Player's Character.
ANIMATION_TRACK = PLAYER_ANIMATOR:LoadAnimation(NEW_ANIMATION);
NEW_TOOL_MODEL.Parent = PLAYER_CHARACTER;
ANIMATION_TRACK.DidLoop:Connect(function() -- Check to see if Animation actually Plays
print("aa")
end)
ANIMATION_TRACK:Play();
print("b")
end
return BSG_Tool
What i’ve done is remove any custom Welds / Motor6Ds / Parts in the Player’s Character because that could be one of the issues, but it’s not, and then i implemented prints inside a DidLoop Connection to check to see if the animation actually runs.
And it only does so on the Server but not the Client, i have tried almost everything and it’s really weird:
Client View:
Server View: (Also seems to overlap normal ROBLOX Core Animations, THIS IS FIXED NOW)
Animation Editor:
The animation also has Looped set to true and has a AnimationTrack.Priority set to Action.
I’ve tried a lot, but nothing seems to work, could someone help?
Thanks for reading.




