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.
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
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…)
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
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
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
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