#Whats the best way to handle two player emotes?

1 messages · Page 1 of 1 (latest)

jagged holly
#

Right now im handling it via a Client Module and A server (for the prompt), but it doesnt seem to work and its always bugging out.

#

i check if the emote has 2 player allowed onto it via this:

    if TwoPlayer and TwoPlayer["2Player"].Value == true then
        TwoPlayerRemote:FireServer("Request", emoteName)
    end

And fires a request to the server making a prox prompt.

#

and then when the prompt is trigger this fires it to both clients

        TwoPlayerRemote:FireClient(requestingPlayer, "Yourself", emoteName, targetPlayer)
        TwoPlayerRemote:FireClient(targetPlayer, "Partner", emoteName, requestingPlayer)
#

which then goes into the module and does this:

TwoPlayerRemote.OnClientEvent:Connect(function(role, emoteName, otherPlayer, syncPos)
        if role == "DelPrompt" then
            local EmotePrompt = Character.HumanoidRootPart:FindFirstChild("EmotePrompt")
            if not EmotePrompt then return end;
            EmotePrompt:Destroy()
            return
        end
        
        local anim = script.Emotes:FindFirstChild(emoteName)
        if not anim then return end
        local twoP = anim:FindFirstChild("TwoPlayer")
        if not twoP then return end

        local subAnim = twoP:FindFirstChild(role)
        if subAnim then
            EmoteController._playSubAnimation(subAnim, role, otherPlayer, syncPos)
            return
        end
    end)
soft flax
jagged holly
soft flax