How to make a animation play for all the developers even if is not the owner?

Hi guys,

I am trying to make a prison game, but i can’t seem to play a animation on my group. Basically, what i’m trying to do, is play a animation but the entire group can see, but i’m just a moderator of the group, not the owner. Aka, trying to make the animation play for the entire group instead of only me. (Also, it only works on studio it doesn’t work on the actual roblox)

Also, the reason i’m posting this on the scripting support, it’s because this is the most popular category, so that’s why i’m posting here.

2 Likes

You could:

  1. Set up a RemoteEvent
  2. Make a ServerScript in ServerScript Service
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayGroupAnimation = ReplicatedStorage:WaitForChild("PlayGroupAnimation")

-- Function to trigger animation for all players in the group --
local function triggerAnimationForGroup(groupId, animationId)
    for _, player in pairs(game.Players:GetPlayers()) do
        if player:IsInGroup(groupId) then
            PlayGroupAnimation:FireClient(player, animationId)
        end
    end
end

-- Example: triggering the animation with a command (adjust as needed for your game) -- 
game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(msg)
        if msg == "!playAnimation" then
            local groupId = 123456 -- Replace with your actual group ID --
            local animationId = "rbxassetid://1234567890" -- Replace with your actual animation ID --
            triggerAnimationForGroup(groupId, animationId)
        end
    end)
end)
  1. Make a localscript inside of StarterPlayerScripts
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayGroupAnimation = ReplicatedStorage:WaitForChild("PlayGroupAnimation")

PlayGroupAnimation.OnClientEvent:Connect(function(animationId)
    local character = game.Players.LocalPlayer.Character
    if character then
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if humanoid then
            local animator = humanoid:FindFirstChildOfClass("Animator")
            if not animator then
                animator = Instance.new("Animator")
                animator.Parent = humanoid
            end

            local animation = Instance.new("Animation")
            animation.AnimationId = animationId

            local animationTrack = animator:LoadAnimation(animation)
            animationTrack:Play()
        end
    end
end)

After you’ve done that, you can just test.

I forgot to mention that in the ServerScript I gave the RemoteEvent a name which is “PlayGroupAnimation” so make sure to do that

That’s… not what i mean, i’m bad at explaining but i’m gonna try to explain again, for some reason, when the owner of the group publishes a animation, it normally would work for him, but not for the other people, BUT it would work for the entire game too, but, the friend i’m with doesn’t know how to publish animations (and i’m lazy to teach him) but in other words, i want to everyone can see the animation, but when I publish, nobody can see my animation, only myself, it doesn’t even apply to the whole game.

SO, did you understand now what i said?

Roblox likes to double-check animations that are uploaded to their website, so it usually takes a while till it applies for everyone, I’ve had that multiple times, but the only thing you need to do is wait.

1 Like

ok, i’m just gonna wait and see if it works

Alright make sure to click on the solved button within my message

1 Like

Well, the button says: “Solved” sooo, i’m just gonna see if it works, i’m gonna try to wait, if it works, i’m marking you as solution, BUT, i’m generous so i’m gonna give you a solution :slight_smile:

1 Like

I just have a question, how much minutes/hours/seconds it takes to double check the animation?

Really depends but average time is about 4-5 days can be longer or shorter.

1 Like

ARE YOU KIDDING??? WHAT THE FU- IT TAKES 4-5 HECK DAYS JUST FOR DOUBLE-CHECK THE THING? bruh

Can depend tbh, like I said it can be shorter than 4-5 days

1 Like

uhhh, my friend is not patient :frowning:

1 Like

your publishing the anim under the group right?

I can’t, and i don’t know why, i think only the owner can, but i’m a moderator

ok so you have to publish the animation under the group. that’s why it’s not showing up for others. i’m not the owner of a group, however in the studio, i can publish the animation, and it shows up for others.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.