breezyshadow012

tentacule

Jul 4th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. repeat wait() until player.Character;
  3. local rs = game:GetService("RunService").RenderStepped
  4. local char = player.Character
  5. local HRP = char.HumanoidRootPart
  6. local Head = char.Head
  7. local tents = {}
  8. function getValue(p, x)
  9. return p[2] + 0.5 * x*(p[3] - p[1] + x*(2.0*p[1] - 5.0*p[2] + 4.0*p[3] - p[4] + x*(3.0*(p[2] - p[3]) + p[4] - p[1])))
  10. end
  11. function getV3Cubic(tabl,perc)
  12. local x,y,z = {},{},{}
  13. if perc >= 2 then
  14. perc = perc %1
  15. for i = 3, 6 do
  16. table.insert(x,tabl[i].x)
  17. table.insert(y,tabl[i].y)
  18. table.insert(z,tabl[i].z)
  19. end
  20. elseif perc >= 1 then
  21. perc = perc %1
  22. for i = 2, 5 do
  23. table.insert(x,tabl[i].x)
  24. table.insert(y,tabl[i].y)
  25. table.insert(z,tabl[i].z)
  26. end
  27. else
  28. for i = 1, 4 do
  29. table.insert(x,tabl[i].x)
  30. table.insert(y,tabl[i].y)
  31. table.insert(z,tabl[i].z)
  32. end
  33. end
  34. local X,Y,Z = getValue(x,perc),getValue(y,perc),getValue(z,perc)
  35. return Vector3.new(X,Y,Z)
  36. end
  37. local rainbow = {"Institutional white","Institutional white","Institutional white","Institutional white","Institutional white","Institutional white","Institutional white","Institutional white","Institutional white"}
  38. local rainbowCount = 1
  39. local isRainbow = true
  40. for i = 0, 4 do
  41. local m = Instance.new("Model",char)
  42. m.Name = "Tentac00l"
  43. local parts = {}
  44. local lastpart = Head
  45. local defC0
  46. rainbowCount = 1
  47. for j = 0, 8 do
  48. local sizex = 0.25 - 0.2 * (j/8)
  49. local sizey = (15/8) - (9/8) * (j/8)
  50. local p = Instance.new("Part")
  51. p.Size = Vector3.new(0.2,0.2,0.2)
  52. p.BrickColor = BrickColor.new("Really black")
  53. p.TopSurface = 0
  54. p.BottomSurface = 0
  55. p.CanCollide = false
  56. p.Material = "SmoothPlastic"
  57. p.TopSurface = 0
  58. p.BottomSurface = 0
  59. local mesh = Instance.new("CylinderMesh",p)
  60. mesh.Name = "CyMesh"
  61. mesh.Scale = Vector3.new(sizex,sizey,sizex) *5
  62. p.Parent = m
  63. local p2 = p:Clone()
  64. p2.Parent = m
  65. p2.CyMesh.Scale = p2.CyMesh.Scale + Vector3.new(0.075,0.001,0.075) * 5
  66. p2.Material = "Neon"
  67. if isRainbow then
  68. p2.BrickColor = BrickColor.new(tostring(rainbow[rainbowCount]))
  69. else
  70. p2.BrickColor = BrickColor.new(j%2 == 1 and "Toothpaste" or "Electric blue")
  71. end
  72. rainbowCount = rainbowCount + 1
  73. p2.Transparency = 0.35
  74. local w2 = Instance.new("Weld",p)
  75. w2.Parent = p2
  76. w2.Part0 = p
  77. w2.Part1 = p2
  78. local w = Instance.new("Weld",p)
  79. w.Parent = p
  80. w.Part0 = lastpart
  81. w.Part1 = p
  82. if j == 0 then
  83. w.C0 = CFrame.Angles(0,math.rad(-10 + 200 * i/4),math.rad(-30 + (i%2==0 and 96 or 70))) * CFrame.new(0,0.6,0)
  84. w.C1 = CFrame.new(0,-0.125,0)
  85. defC0 = w.C0
  86. else
  87. w.C0 = CFrame.new(0,lastpart.CyMesh.Scale.y/10,0)
  88. w.C1 = CFrame.new(0,-sizey/2,0)
  89. end
  90. table.insert(parts,{p,w,p2})
  91. lastpart = p
  92. rs:wait()
  93. end
  94. local randoms = {Vector3.new(0,0,0),
  95. Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100),
  96. Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100),
  97. Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100);
  98. Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100);
  99. Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100);
  100. }
  101. table.insert(tents,{0,randoms,parts,defC0})
  102. end
  103. player.Chatted:connect(function(msg)
  104. if string.sub(msg:lower(),1,4) == "col/" then
  105. for i, v in pairs(tents) do
  106. for j, o in pairs(v[3]) do
  107. o[3].BrickColor = BrickColor.new(string.sub(msg,5))
  108. end
  109. end
  110. elseif string.sub(msg:lower(),1,7) == "/e col/" then
  111. for i, v in pairs(tents) do
  112. for j, o in pairs(v[3]) do
  113. o[3].BrickColor = BrickColor.new(string.sub(msg,8))
  114. end
  115. end
  116. end
  117. end)
  118. rs:connect(function()
  119. for i, v in pairs(tents) do
  120. v[1] = v[1] %200 + 1
  121. if v[1] == 1 then
  122. v[2][1] = v[2][2]
  123. v[2][2] = v[2][3]
  124. v[2][3] = v[2][4]
  125. v[2][4] = v[2][5]
  126. v[2][5] = v[2][6]
  127. v[2][6] = Vector3.new(math.random(-28,28)/100,math.random(-42,42)/100,math.random(-28,28)/100)
  128. end
  129. local p0 = v[2][1]
  130. local p1 = v[2][2]
  131. local p2 = v[2][3]
  132. local p3 = v[2][4]
  133. local p4 = v[2][5]
  134. local p5 = v[2][6]
  135. local arr = {p0,p1,p2,p3,p4,p5}
  136. local dir = i%2 == 0 and 1 or -1
  137. for j, V in pairs(v[3]) do
  138. local val = math.sin(math.pi/2 * 2 * (((v[1] + (100 * j/#v[3])*dir) % 100)/100))
  139. local off = getV3Cubic(arr,(v[1] + 340*(j/#v[3]))/200)
  140. V[3].Transparency = 0.12 + val * 0.65
  141. if j == 1 then
  142. V[2].C0 = v[4] * CFrame.Angles(off.x*2,off.y*2,off.z*2)
  143. else
  144. V[2].C0 = CFrame.new(0,V[2].C0.y,0) * CFrame.Angles(off.x*2 * (1 + 0.75 * (j/#v[3])),off.y*2 * (1 + 0.75 * (j/#v[3])),off.z*2 * (1 + 0.75 * (j/#v[3])))
  145. end
  146. end
  147. end
  148. end)
Add Comment
Please, Sign In to add comment