Advertisement
Guest User

Untitled

a guest
Aug 6th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.21 KB | None | 0 0
  1. local Percentage = 1 -- 1 = normal, 0.5 = half your normal size, 2 = double your normal size
  2. local NewPercentage = Vector3.new(1,1.5,1)
  3.  
  4. local FixedPercentage = Vector3.new(1, 1/1.5,1)
  5. local HeadPercentage = Vector3.new(1,1.5,1)
  6. local LastGrowth = 0
  7. local HumanoidTable = { ["Head" ] ="Head"}
  8.  
  9. script.Parent.Touched:Connect(function(Hit)
  10.     if time() - LastGrowth > 1 then
  11.         LastGrowth = time()
  12.    
  13.         local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
  14.        
  15.         if Player and Player.Character:FindFirstChild("AppliedGrowth") == nil then
  16.             local Motors = {}
  17.             local NewMotors = {}
  18.             local NewVal = Instance.new("BoolValue")
  19.             NewVal.Name = "AppliedGrowth"
  20.             NewVal.Parent = Player.Character
  21.            
  22.            
  23.             for i,v in pairs(Player.Character.Torso:GetChildren()) do
  24.                 if v:IsA("Motor6D") then
  25.                     table.insert(Motors, v)
  26.                 end
  27.             end
  28.             table.insert(Motors, Player.Character.HumanoidRootPart.RootJoint)
  29.            
  30.             local HatWelds = {}
  31.             for i,v in pairs(Player.Character:GetChildren()) do
  32.                 if v:IsA("Accessory") then
  33.                     v.Handle.AccessoryWeld.C0 = CFrame.new((v.Handle.AccessoryWeld.C0.p * Percentage)) * (v.Handle.AccessoryWeld.C0 - v.Handle.AccessoryWeld.C0.p)
  34.                     v.Handle.AccessoryWeld.C1 = CFrame.new((v.Handle.AccessoryWeld.C1.p * Percentage)) * (v.Handle.AccessoryWeld.C1 - v.Handle.AccessoryWeld.C1.p)
  35.                     table.insert(HatWelds, {v.Handle.AccessoryWeld:Clone(), v.Handle})
  36.                     v.Handle.SpecialMesh.Scale = v.Handle.SpecialMesh.Scale * Percentage
  37.                 end
  38.             end
  39.            
  40.             for i,v in pairs(Motors) do
  41.  
  42.                 local X, Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = v.C0:components()
  43.                
  44.                 X = X * 1
  45.                 Y = Y *1.5
  46.                 Z = Z * 1
  47.                
  48. --              --
  49. --              R00 = R00 * Percentage
  50. --              R01 = R01 * Percentage
  51. --              R02 = R02 * Percentage
  52. --              --
  53. --              R10 = R10 * Percentage
  54. --              R11 = R11 * Percentage
  55. --              R12 = R12 * Percentage
  56. --              --
  57. --              R20 = R20 * Percentage
  58. --              R21 = R21 * Percentage
  59. --              R22 = R22 * Percentage
  60. --             
  61.                 v.C0 = CFrame.new(X, Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
  62.                
  63.                 local X, Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = v.C1:components()
  64.                 X = X * 1
  65.                 Y = Y * 1.5
  66.                 Z = Z * 1
  67.                
  68. --              --
  69. --              R00 = R00 * Percentage
  70. --              R01 = R01 * Percentage
  71. --              R02 = R02 * Percentage
  72. --              --
  73. --              R10 = R10 * Percentage
  74. --              R11 = R11 * Percentage
  75. --              R12 = R12 *Percentage
  76. --              --
  77. --              R20 = R20 * Percentage
  78. --              R21 = R21 * Percentage
  79. --              R22 = R22 * Percentage
  80.                 v.C1 = CFrame.new(X, Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
  81.                
  82.                 table.insert(NewMotors, {v:Clone(), v.Parent})
  83.                 v:Destroy()
  84.             end
  85.             for i,v in pairs(Player.Character:GetChildren()) do
  86.                
  87.                 if v:isA("BasePart") then
  88.                     if  HumanoidTable[v.Name] == nil then
  89.                     v.Size  = v.Size*NewPercentage
  90.                     end
  91.                    
  92.                     if  HumanoidTable[v.Name] ~= nil then
  93.                         v.Size  = v.Size*HeadPercentage
  94.                         Player.Character.Head.Size = Player.Character.Head.Size*FixedPercentage
  95.                 end
  96.                
  97.                 end
  98.                
  99.                    
  100.                
  101.                
  102.             for i,v in pairs(NewMotors) do
  103.                 v[1].Parent = v[2]
  104.             end
  105.            
  106.                 for i,v in pairs(HatWelds) do
  107.                 v[1].Part1 = Player.Character.Head
  108.                 v[1].Parent = v[2]
  109.             end
  110.         end
  111.     end
  112.     end
  113. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement