PhantomFood4

ProjectCube

Jul 5th, 2020 (edited)
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. function ZCube()
  2.  
  3. local function round(number,deci)
  4. local num = tostring(number)
  5. local num2 = ""
  6. local num3 = ""
  7. local num4
  8. local num5
  9. local savevar1 = ""
  10. if deci ~= 0 then
  11. if num2 ~= "" then num = num2 end
  12. for i=1,#num do
  13. if string.sub(num,i,i) == "." then
  14. num3 = tonumber(string.sub(num,deci+i+1,deci+i+1))
  15. num4 = tonumber(string.sub(num,deci+i,deci+i))
  16. if num3 == "" or num3 == nil then break end
  17. if num3 >= 5 then
  18. num = string.sub(num,1,i-1+deci)..tostring(num4+1)
  19. else
  20. num = string.sub(num,1,i-1+deci)..tostring(num4)
  21. end
  22. end
  23. end
  24. else
  25. for i=1,#num do
  26. if string.sub(num,i,i) == "." then
  27. num3 = string.sub(num,i+1,i+1)
  28. num5 = string.sub(num,i-1,i-1)
  29. num4 = i
  30. break
  31. end
  32. end
  33. num3 = tonumber(num3)
  34. num5 = tonumber(num5)
  35. if num3 >= 5 then
  36. num = string.sub(num,1,num4-2)..tostring(num5+1)
  37. else
  38. num = string.sub(num,1,num4)
  39. end
  40. num = tonumber(num)
  41. end
  42. return num
  43. end
  44.  
  45. local function compareColors(color1,color2)
  46. local r1 = round(color1.R,1)
  47. local g1 = round(color1.G,1)
  48. local b1 = round(color1.B,1)
  49. local r2 = round(color2.R,1)
  50. local g2 = round(color2.G,1)
  51. local b2 = round(color2.B,1)
  52.  
  53. if (r1 == r2 and b1 == b2 and g1 == g2) then
  54. return true
  55. else
  56. return false
  57. end
  58. end
  59.  
  60. local ZombieP = Instance.new("Part",workspace)
  61. ZombieP.Position = Vector3.new(22,3,10)
  62. ZombieP.Size = Vector3.new(2,2,2)
  63. ZombieP.Anchored = true
  64. ZombieP.Material = ("Neon")
  65. ZombieP.BrickColor = BrickColor.new("Bright green")
  66. ZombieP.Locked = true
  67. local ClickZ = Instance.new("ClickDetector", ZombieP)
  68.  
  69.  
  70. function Green(player)
  71. player.Character["Head"].Color = Color3.new(0,1,0)
  72. player.Character["Torso"].Color = Color3.new(0,1,0)
  73. player.Character["Left Leg"].Color = Color3.new(0,1,0)
  74. player.Character["Left Arm"].Color = Color3.new(0,1,0)
  75. player.Character["Right Arm"].Color = Color3.new(0,1,0)
  76. player.Character["Right Leg"].Color = Color3.new(0,1,0)
  77. player.Character.Humanoid.WalkSpeed = 10
  78.  
  79. local Check = false
  80.  
  81. player.Character.Torso.Touched:Connect(function(hit)
  82. if game.Players:GetPlayerFromCharacter(hit.Parent) and not compareColors(hit.Parent.Torso.Color,Color3.new(0,1,0)) and not Check then
  83. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
  84. Check = true
  85. wait(1.5)
  86. Check = false
  87. end
  88. end)
  89. end
  90.  
  91. local function ZClicked(player)
  92. Green(player)
  93. ZombieP.BrickColor = BrickColor.new("Really black")
  94. wait(.5)
  95. ZombieP.BrickColor = BrickColor.new("Bright green")
  96. end
  97.  
  98. ClickZ.MouseClick:connect(ZClicked)
  99. end
  100.  
  101.  
  102. function BCube
  103. ()local SoundP = Instance.new("Part",workspace)
  104. SoundP.Position = Vector3.new(10,3,10)
  105. SoundP.Size = Vector3.new(2,2,2)
  106. SoundP.Anchored = true
  107. SoundP.Material = ("SmoothPlastic")
  108. SoundP.BrickColor = BrickColor.new("Medium stone grey")
  109. SoundP.Locked = true
  110. local ClickD = Instance.new("ClickDetector", SoundP)
  111. local Sound = Instance.new("Sound",SoundP)
  112.  
  113. local function soundplay()
  114. Sound.SoundId = "rbxassetid://2803889112"
  115. Sound.Volume = 5
  116. Sound:Play()
  117. Sound.TimePosition = .5
  118. end
  119.  
  120. local function Clicked()
  121. soundplay()
  122. SoundP.BrickColor = BrickColor.new("Bright orange")
  123. SoundP.Material = ("Neon")
  124. wait(.5)
  125. SoundP.BrickColor = BrickColor.new("Medium stone grey")
  126. SoundP.Material = ("SmoothPlastic")
  127. end
  128.  
  129. ClickD.MouseClick:connect(Clicked)
  130.  
  131.  
  132.  
  133. local Apart = Instance.new("Part",workspace)
  134. Apart.Position = Vector3.new(10, 9.25, 10)
  135. Apart.Anchored = true
  136. Apart.Material = ("Neon")
  137. Apart.Size = Vector3.new(.5,1.5,0.5)
  138. Apart.Locked = true
  139.  
  140. local Awedge1 = Instance.new("WedgePart",workspace)
  141. Awedge1.Position = Vector3.new(9.625, 7.75, 10)
  142. Awedge1.Anchored = true
  143. Awedge1.Material = ("Neon")
  144. Awedge1.Size = Vector3.new(0.5, 0.75, 1.5)
  145. Awedge1.Orientation = Vector3.new(-90, 90, 0)
  146. Awedge1.Locked = true
  147.  
  148. local Awedge2 = Instance.new("WedgePart",workspace)
  149. Awedge2.Position = Vector3.new(10.375, 7.75, 10)
  150. Awedge2.Anchored = true
  151. Awedge2.Material = ("Neon")
  152. Awedge2.Size = Vector3.new(0.5, 0.75, 1.5)
  153. Awedge2.Orientation = Vector3.new(-90, -90, 0)
  154. Awedge2.Locked = true
  155. end
  156.  
  157. function HCube()
  158. local HealP = Instance.new("Part",workspace)
  159. HealP.Position = Vector3.new(18,3,10)
  160. HealP.Size = Vector3.new(2,2,2)
  161. HealP.Anchored = true
  162. HealP.Material = ("SmoothPlastic")
  163. HealP.BrickColor = BrickColor.new("Bright green")
  164. HealP.Locked = true
  165. local ClickH = Instance.new("ClickDetector", HealP)
  166.  
  167. function Heal(player)
  168. player.Character.Humanoid.Health = 100
  169.  
  170. end
  171.  
  172. local function HClicked(player)
  173. Heal(player)
  174. HealP.Material = ("Neon")
  175. wait(.5)
  176. HealP.Material = ("SmoothPlastic")
  177. end
  178.  
  179. ClickH.MouseClick:connect(HClicked)
  180.  
  181. end
  182.  
  183. function DCube()
  184. local DamageP = Instance.new("Part",workspace)
  185. DamageP.Position = Vector3.new(14,3,10)
  186. DamageP.Size = Vector3.new(2,2,2)
  187. DamageP.Anchored = true
  188. DamageP.Material = ("SmoothPlastic")
  189. DamageP.BrickColor = BrickColor.new("Bright red")
  190. DamageP.Locked = true
  191. local ClickD = Instance.new("ClickDetector", DamageP)
  192.  
  193. function Damage(player)
  194. player.Character.Humanoid.Health = player.Character.Humanoid.Health - 20
  195.  
  196. end
  197.  
  198. local function DClicked(player)
  199. Damage(player)
  200. DamageP.Material = ("Neon")
  201. wait(.5)
  202. DamageP.Material = ("SmoothPlastic")
  203. end
  204.  
  205. ClickD.MouseClick:connect(DClicked)
  206. end
  207.  
  208. for i,v in pairs(game.Players:GetChildren())do v.Chatted:Connect(function(msg)
  209. if msg == ";DCube" then DCube()
  210. elseif msg == ";HCube" then HCube()
  211. elseif msg == ";BCube" then BCube()
  212. elseif msg == ";ZCube" then ZCube()
  213. elseif msg == ";AllCubes" then HCube() BCube() ZCube() DCube()
  214.  
  215. end
  216. end)
  217. end
Add Comment
Please, Sign In to add comment