Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tempStorage = game:GetService("InsertService"):LoadAsset(159273369).Mirror
- mirror = {}
- storage = nil
- currentOffset = nil
- player = game.Players.LocalPlayer
- clothingMaps = {[142018192] = 159265355;}
- textureLimbs = {["Torso"] = true;["Right Arm"] = true;["Right Leg"] = true;["Left Leg"] = true;["Left Arm"] = true}
- function checkNew(v)
- if v.Name == "Footstep" then return end
- if v:IsA("Model") then
- for _,a in pairs(v:GetChildren()) do
- checkNew(a)
- end
- v.ChildAdded:connect(checkNew)
- return
- end
- if not mirror[v] and not v:IsA("Script") and not v:IsA("Humanoid") then
- local c = v:clone()
- c.Parent = storage
- if c:IsA("BasePart") then
- c.CanCollide = false
- c.CFrame = v.CFrame
- end
- mirror[v] = c
- end
- end
- function updateMirror()
- for k,v in pairs(mirror) do
- if k.Parent then
- if v:IsA("BasePart") then
- v.CanCollide = false
- v.Anchored = true
- v.BrickColor = k.BrickColor
- v.CFrame = k.CFrame
- end
- else
- v:Destroy()
- mirror[k] = nil
- end
- end
- end
- game:GetService("RunService").RenderStepped:connect(updateMirror)
- player.CameraMaxZoomDistance = 0.5
- function onCharAdded(char)
- char.ChildAdded:connect(checkNew)
- if storage then
- storage:Destroy()
- end
- storage = tempStorage:clone()
- storage.Parent = workspace.CurrentCamera
- mirror = {}
- for _,v in pairs(storage:GetChildren()) do
- if char:findFirstChild(v.Name) then
- mirror[char:findFirstChild(v.Name)] = v
- end
- end
- char:WaitForChild("FootSteps")
- char.Archivable = true
- for _,v in pairs(char:GetChildren()) do
- if not mirror[v] then
- checkNew(v)
- end
- end
- local humanoid = char:WaitForChild("humanoid")
- local y = workspace.CurrentCamera.CoordinateFrame.lookVector.Y
- humanoid.CameraOffset = Vector3.new(1.5,0.5+y,3.5)
- local shirt = char:WaitForChild("Shirt")
- local id = tonumber(string.match(shirt.ShirtTemplate,"%d+"))
- if id and clothingMaps[id] then
- for _,v in pairs(mirror) do
- print(v.Name)
- print(textureLimbs[v.Name])
- if textureLimbs[v.Name] then
- local d = Instance.new("Decal",v)
- d.Texture = "rbxassetid://"..clothingMaps[id]
- end
- end
- end
- end
- if player.Character then
- onCharAdded(player.Character)
- end
- player.CharacterAdded:connect(onCharAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement