Advertisement
CloneTrooper1019

Untitled

May 30th, 2014
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. tempStorage = game:GetService("InsertService"):LoadAsset(159273369).Mirror
  2. mirror = {}
  3. storage = nil
  4. currentOffset = nil
  5. player = game.Players.LocalPlayer
  6.  
  7. clothingMaps = {[142018192] = 159265355;}
  8. textureLimbs = {["Torso"] = true;["Right Arm"] = true;["Right Leg"] = true;["Left Leg"] = true;["Left Arm"] = true}
  9.  
  10. function checkNew(v)
  11. if v.Name == "Footstep" then return end
  12. if v:IsA("Model") then
  13. for _,a in pairs(v:GetChildren()) do
  14. checkNew(a)
  15. end
  16. v.ChildAdded:connect(checkNew)
  17. return
  18. end
  19. if not mirror[v] and not v:IsA("Script") and not v:IsA("Humanoid") then
  20. local c = v:clone()
  21. c.Parent = storage
  22. if c:IsA("BasePart") then
  23. c.CanCollide = false
  24. c.CFrame = v.CFrame
  25. end
  26. mirror[v] = c
  27. end
  28. end
  29.  
  30. function updateMirror()
  31. for k,v in pairs(mirror) do
  32. if k.Parent then
  33. if v:IsA("BasePart") then
  34. v.CanCollide = false
  35. v.Anchored = true
  36. v.BrickColor = k.BrickColor
  37. v.CFrame = k.CFrame
  38. end
  39. else
  40. v:Destroy()
  41. mirror[k] = nil
  42. end
  43. end
  44. end
  45.  
  46. game:GetService("RunService").RenderStepped:connect(updateMirror)
  47.  
  48. player.CameraMaxZoomDistance = 0.5
  49.  
  50. function onCharAdded(char)
  51. char.ChildAdded:connect(checkNew)
  52. if storage then
  53. storage:Destroy()
  54. end
  55. storage = tempStorage:clone()
  56. storage.Parent = workspace.CurrentCamera
  57. mirror = {}
  58. for _,v in pairs(storage:GetChildren()) do
  59. if char:findFirstChild(v.Name) then
  60. mirror[char:findFirstChild(v.Name)] = v
  61. end
  62. end
  63. char:WaitForChild("FootSteps")
  64. char.Archivable = true
  65. for _,v in pairs(char:GetChildren()) do
  66. if not mirror[v] then
  67. checkNew(v)
  68. end
  69. end
  70. local humanoid = char:WaitForChild("humanoid")
  71. local y = workspace.CurrentCamera.CoordinateFrame.lookVector.Y
  72. humanoid.CameraOffset = Vector3.new(1.5,0.5+y,3.5)
  73. local shirt = char:WaitForChild("Shirt")
  74. local id = tonumber(string.match(shirt.ShirtTemplate,"%d+"))
  75. if id and clothingMaps[id] then
  76. for _,v in pairs(mirror) do
  77. print(v.Name)
  78. print(textureLimbs[v.Name])
  79. if textureLimbs[v.Name] then
  80. local d = Instance.new("Decal",v)
  81. d.Texture = "rbxassetid://"..clothingMaps[id]
  82. end
  83. end
  84. end
  85. end
  86.  
  87. if player.Character then
  88. onCharAdded(player.Character)
  89. end
  90.  
  91. player.CharacterAdded:connect(onCharAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement