Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Mirror = game.Workspace:WaitForChild("Mirror")
- local RunService = game:GetService("RunService");
- local Mirror = game.Workspace:WaitForChild("Mirror")
- local RunService = game:GetService("RunService");
- local function reflect()
- for i, v in next, game.Players:GetPlayers() do
- if (v) ~= nil then
- if (v.Character) ~= nil then
- for a, b in next, v.Character:GetDescendants() do
- if (b) ~= nil then
- if b:IsA("BasePart") or b:IsA("UnionOperation") or b:IsA("MeshPart") or b:IsA("Motor6D") then
- if not b:IsA("Motor6D") then
- local objectSpace = Mirror.CFrame:Inverse() * (v.Character:GetPrimaryPartCFrame());
- local yaw, pitch, roll = objectSpace:ToEulerAnglesXYZ()
- local worldSpace = Mirror.CFrame:ToWorldSpace(CFrame.new(objectSpace.X, objectSpace.Y, -objectSpace.Z) * CFrame.Angles(yaw, -pitch, roll));
- v.Character.Archivable = true;
- local newCharacter;
- if not workspace:FindFirstChild("Dummy") then
- newCharacter = v.Character:Clone()
- newCharacter.Name = "Dummy"
- newCharacter.Parent = workspace;
- end
- local new = workspace:FindFirstChild("Dummy")
- if new then
- local set = worldSpace * CFrame.Angles(0, -math.pi, 0)
- new:SetPrimaryPartCFrame(set)
- end
- else
- local new = workspace:FindFirstChild("Dummy")
- if new then
- local motor = new:FindFirstChild(b.Name, true)
- if motor and motor.Name == b.Name then
- motor.Part0 = new:FindFirstChild(b.Part0.Name)
- motor.Part1 = new:FindFirstChild(b.Part1.Name)
- motor.CurrentAngle = b.CurrentAngle
- end
- end
- end
- end
- end
- end
- end
- end;
- end;
- end;
- RunService.RenderStepped:Connect(reflect);
Add Comment
Please, Sign In to add comment