How to make Animation not show on serverside, only CilentSide

to make Animation not visible on Serversides, instead i wanted to make Animation visible in cilentside, i know i am weird person, but i wanted to make this happen to order save performance.

Cilentsided
ServerSide

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

	for _, NotRelated in pairs(ItemFolder:GetChildren()) do
					if NotRelated.Name ~= Clone.Name then
						NotRelated:Destroy()
					end
				end

				if animation:IsA("Animation") and humanoid:IsA("Humanoid") then
					animation.AnimationId = "rbxassetid://86930228030235"
					local track = humanoid:LoadAnimation(animation)
					track:Play()
					Clone.equip:Play()
			
					
					Clone.SpotLight.Enabled = true
					animation.AnimationId = "rbxassetid://139002827072601"
					local track1 = humanoid:LoadAnimation(animation)
					track1.Looped = true
					track1:Play()
				

					-- Start checking for flashlight turning off
					local connection
					Clone.Sound:Play()
					connection = RunService.Heartbeat:Connect(function()
						if not flashlight then
							print("Flashlight turned off. Stopping animation.")
							track1:Stop()
							connection:Disconnect()
						end
					end)
				end 

to mention, this is not full localscript :confused:

And no, i am not putting item in serversides

2 Likes

Just to confirm — you only want the animation to play on the client, right? If that’s the case, all you need to do is handle it inside a LocalScript. (The creation of the animation, playing the animation, etc…)

i only want make animation play on cilents, Also all animation are played by localscript, not script

Did you try setting the network ownership to the character?

So you need to have Animator thing somehow to be created on client, so animations don’t replicate to server…

Try to delete Animator when player’s character is loaded, it should work I think

Here’s the information source.


I honestly didn’t try this in any way, just a quick search, so don’t take this post too seriously :sweat_smile:

But if you need some further help, let me know! Maybe my dumb brain will get an idea or smth

not to be rude but what do you mean Animator?

The main class responsible for the playback and replication of Animations. All replication of playing AnimationTracks is handled through the Animator instance.

So it’s like a connector between client and server animations

when i tried to delete Animator, it instantly froze any animations

Wait i didn’t read properly, i did not read " So you need to have Animator thing somehow to be created on client"

it did work,


but, there is one tiny problem

What problem? Is it not being played on Client?

it did played on cilent but, in serverside. it did not played

Was it the thing you wanted to achieve?

No, i meant like i wanted custom animation play in the Cilent, and all of default animation should play in serverside

I think I have a solution, but it’s kinda weird. Just play the animation on client and then fire a remote event to all clients and just stop the animation from their client

what do you mean, stop the animation from their cilent?

Basically, once the animation is started, just fire a remote to all clients (or use bindable events). Then, from the client side once they receive the remote event, just stop the user’s animation from their client

No like, how do you stop custom animation?

Yeah thats how you do it, lemme send some code:

client script

local event = Your_event_path


--Animation is played
event:FireAllClients(anim) -- anim is your animation

--Receiving end
event.OnClientEvent(function(plr)
    if plr ~= game.Players.LocalPlayer then
        anim:Stop()
    end
end)

This is an outline, no idea if this works or not btw, just giving you an idea, since I wouldn’t do it like this

1 Like

Oh, i get, okay. i will try, but i need some hour to play