Using welds and constraints locally to make a fake Tool equipping animation (Since local animations don't work)

Well ok this is what I’m trying to do. I have a tool that is duplicated and made in the client and I focus equip it. I have hidden the toolbar so it can’t be equipped and unequipped. In the Local script I run :EquipTool and even though it’s run on the client, the animation of equipping is run on the server. And I want it to run on the client only

1 Like

game.Players.LocalPlayer.Character:FindFirstChildWhichIsA(“Humanoid”):EquipTool(clone)

why arent you using :WaitForChild() or :FindFirstChild()? might be unrelated but whatever youre doing here in these lines youre grabbing both players

1 Like

This isn’t the whole script as it’s connected in the function. Again they are local scripts so It connects one person in that local script. Totally get and understand why your confused, but my script is already loads beforehand. If I send the full script often people are less likely to help, and I know the issue is relying in the EquipTool: part.

1 Like

run some debug prints and figure out every single little piece in that thing is what you need it to be cause if thats where you think it is

1 Like

I am certain it is that. And this is a default behavior on roblox (Which idk why if this is ran on a local script as its driving me crazy lol). If you would like to run some tests here is what you can do:

→ Make a tool in rep. stroage. Make a local script in a place that runs local scripts

→ Add the following in the local script, and change as needed for the tool

repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
local toolclone = game.ReplicatedStorage.Tool:Clone()
print("Loaded")
task.wait(5)
print("Equipping")
--toolclone.Parent = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):EquipTool(toolclone)

And switch inbetween the client and the server.

I can say for certain that it is :EquipTool function or aka ToolClone.Parent = Character that causes this issue

animations automatically transfer server wide

1 Like

Well this does certainly fix my issue it causes other problems such as walking animations breaking on the server (edit). So How can I fix it so that the walking animation is normal as well as any other animation is ok, while the tool animation is local and doesn’t break

well given this code that i havent tried out

local lp = game.Players.LocalPlayer
while not lp.Character or not lp.Character.Parent do wait() print'waiting for char' end
local Character = lp.Character --script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local oldanimator = Humanoid:WaitForChild'Animator'
oldanimator:Destroy()
local newanimator = Instance.new('Animator',Humanoid)

i would say dont destroy the old animator just run ur animations through the new animator but thatll probably not work because i have a hunch roblox wont accept two animators

1 Like

I used a very similar code, I’ll try not deleting it and post it in an edit. The issue is that the Tool when equipped, I don’t pick the animatior for it… It just uh… roblox does that… But let me see

Edit: It just default to the local one made. It doesn’t care

2 Likes

this is definitelly a tricky one my idea was kinda brain dead cause its late. the real way to do it would be revert ur actions after running the animation (go back to the normal animator) WHICH i have no idea how to do so im curious why u dont want other players seeing an action u are doing

1 Like

Reason we want client oriented tools: well because the tool is on the client and managed on the client. Like in this case its a latern, and the area for the usage for the latern is small, and so having 4 users (our max amount) with 4 latern can light up the entire area. There is also other areas that tools aren’t naturally available, unless doing certain things (To allow secrets and different storylines activate) So we don’t want one player to be able to see them doing something else in the area by this animation issue.

2 Likes

ahh i see so you are trying to hide players actions to not giveaway the puzzles in ur game damn ur reasoning is pretty solid

1 Like

i just read this worth a shot: “If the animation object is instanced locally the animation will only replicate locally, if the animation is instanced by the server but then the animation track is played locally the animation will still replicate to the server.”

so what that means is you should create the animation object by instance.new() in ur local script WORTH A SHOT

1 Like

These is what I have:

repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
local toolclone = game.ReplicatedStorage.Tool:Clone()
--toolclone.Parent = game.Players.LocalPlayer.Character
--game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):FindFirstChildWhichIsA("Animator"):Destroy()
local animator = Instance.new("Animator", game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"))
print("Loaded")
task.wait(5)
print("Equipping")
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):EquipTool(toolclone)

Same outcome… Though this gives me an idea…

forget the whole new animator thing what u need to do is instantiate the entire animation objects in ur local script l

you do have each animation stored in sumn like this right:
image

Well I don’t have any animations. Its just the default animations. So like the Default roblox tool equip animation, and the default player animation pack for walking etc.

1 Like

I just tried connecting a remote event and add a new animator locally and on the server → and the behavior is connected to the most recently added animator (Which is nice to know, but doesn’t fix the issue)

i recommend that u ditch the default animation thing for ur tool and as a whole probably the default tool system cause its very limiting i dont think a lot of games use it anymore unless they are really simple it makes custom stuff like this harder you dont want the server to create anything you should look into player animations and then run animations directly on the player fully on the client side that means instantiating the animation instances on the client side and running them on the client side im not sure if it will work because this is a veryyyy rare case it seems but thats my best advice

2 Likes

Ok give me a minute to make a ‘basic’ equipping animation for this test and I’ll let you know my results

@S0MBRX Results are in… They aren’t awesome?..

  1. Result (Without adding a server Animator, Without deleting Old Server Animation & Without adding a server Animator, With deleting Old Server Animation): Same before, Walking Animations break on server, everything else works perfectly on client

  2. Result (With adding a server Animator, Without deleting Old Server Animation & With adding a server Animator, With deleting Old Server Animation): Custom Equip animation Breaks As soon as the server one is added, walking works fine on server, animation for equipping breaks

local script to “add a custom equip Animation” (Removed default Tool Equipping in the Animate script roblox adds):

repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
local toolclone = game.ReplicatedStorage.Tool:Clone()
--toolclone.Parent = game.Players.LocalPlayer.Character
--game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):FindFirstChildWhichIsA("Animator"):Destroy()

local animator = Instance.new("Animator", game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"))
local animation = animator:LoadAnimation(game.ReplicatedStorage.EquipAnimation)
animation.Looped = true

print("Loaded")
task.wait(5)
print("Equipping")
animation:Play()
toolclone.Parent = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid"):EquipTool(toolclone)
--game.ReplicatedStorage.MakeANewAnimatior:FireServer()