#Animation plays for me, BUT not for other players...

1 messages · Page 1 of 1 (latest)

maiden hinge
#

Good day to all who see this, I'm trying to make a fun private server where I can morph into characters to have fun with friends, so I'm not exactly very into lua yet.

I've been trying to make a morph thing where you click on a model and morph into it, so far it has worked on almost everything except for the animations. The script is the following

local clickdetector = model.ClickDetector

function onClick(player)
    local char = player.Character
    local morph = model:Clone()

    morph.HumanoidRootPart.Anchored = false
    morph:SetPrimaryPartCFrame(char.PrimaryPart.CFrame)

    player.Character = morph
    morph.Parent = workspace
end

clickdetector.MouseClick:Connect(onClick)print("Hello world!")```

After this script, I would click on the character and morph into it, but I would not have the original r15 animations. I found out that to solve this I could copy and paste the "Animate" script that spawns with the player and put it on my model, and it worked for the client side, but not for the server / when other people are looking at me. How can I then put the default animate script to the server so other people can see it?

Here in the script you can see me doing a /e dance emote on one client and on the other you can see the other player would just see a t pose.
faint rain
#

test it in a real server

maiden hinge
# faint rain test it in a real server

The problem actually happened once I was running it on actual Roblox, so I went over to check in Roblox studio if the problem was replicated there and there it was as well

faint rain
#

do you own the animation

maiden hinge
#

It's the default Animate script from Roblox for basic things like walking, jumping etc, I evidently have the animations in my game and can see them so I'm guessing I do?

grave jungle
#

moment

faint rain
#

you shouldnt even need to put Animate into the model because roblox automatically does it

rugged wave
graceful skiffBOT
#

studio** You are now Level 1! **studio

copper sorrel
#

After setting player.Character = morph, also clone the player's original Animate script from their old character into the new morph, and parent it under the new morph

maiden hinge
# copper sorrel After setting player.Character = morph, also clone the player's original Animate...

How can u do such a thing? I tried doing it w/ assistant (lol) and here´s what we cooked up but it ended up breaking the morph script

local clickdetector = model.ClickDetector

function onClick(player)
    local char = player.Character
    local morph = model:Clone()

    morph.HumanoidRootPart.Anchored = false
    morph:SetPrimaryPartCFrame(char.PrimaryPart.CFrame)

    player.Character = morph
    morph.Parent = workspace
    
    local function morphCharacter(newCharacterModel)
        local oldAnimateScript = character:FindFirstChild("Animate")
        if oldAnimateScript then
            local newAniamteScript = oldAnimateScript:Clone()
            
            player.Character = newCharacterModel
            
            newAniamteScript.Parent = newCharacterModel
        end
    
end

clickdetector.MouseClick:Connect(onClick)print("Hello world!")
copper sorrel
#
local model = script.Parent
local clickdetector = model.ClickDetector

function onClick(player)
    local char = player.Character
    local morph = model:Clone()

    morph.HumanoidRootPart.Anchored = false
    morph:SetPrimaryPartCFrame(char.PrimaryPart.CFrame)
    morph.Parent = workspace

    local oldAnimate = char:FindFirstChild("Animate")
    if oldAnimate then
        local newAnimate = oldAnimate:Clone()
        newAnimate.Parent = morph
    end

    player.Character = morph
end

clickdetector.MouseClick:Connect(onClick)
#

the morphCharacter function is never called in your script that one should work