Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making a mirror script? Player mirroring?

Asked by 4 years ago

Hi, I've been trying to make a mirror and this is what happens:

https://youtu.be/3ydSPUQ5lsE

I just need help with the character-portian of it

My script:

local players = {}

game.Players.PlayerAdded:Connect(function(plr)
    print("PLAYER ADDED")
    if not players[plr.Name] then
        repeat wait() until workspace:FindFirstChild(plr.Name)
        local char=plr.Character:Clone()
        char.Parent=workspace.MirrorPlayers
        players[plr.Name]=char
    end
end)

game:GetService("RunService").Heartbeat:Connect(function()
    for i,v in pairs(game.Players:GetPlayers()) do
        if players[v.Name] then
            local cf = workspace.M1.CFrame:ToObjectSpace(v.Character.HumanoidRootPart.CFrame)*CFrame.Angles(0,math.pi,0)*CFrame.new(-1,-0.9,0)
            local cf2 = workspace.M2.CFrame*cf
            players[v.Name].HumanoidRootPart.CFrame = cf2
        end
    end
end)
0
clone, get distance from mirror, add the inverse of the magnitude (basically -magnitude) to the mirror, then use a loop to properly position and set cframe according to base player Fifkee 2017 — 4y
0
Ok i fixed a lot of the problems but now the character is backwards. Any ideas? Sorry, I never scripted a mirror before :/ the8bitdude11 358 — 4y
0
and how do i replicate animations? the8bitdude11 358 — 4y

Answer this question