pheonin55

Untitled

May 6th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.37 KB | None | 0 0
  1. ------------------------Variables---------------------------
  2. Player = "MaxyTDM"
  3. ------------------------------------------------------------
  4. ----------------------Initilization-------------------------
  5. Player = game.Players[Player]
  6. char = Player.Character
  7. mode1 = "nothing"
  8. mode2 = "nothing"
  9. busy = false
  10. function Color(r, g, b)
  11. return Color3.new(r/255, g/255, b/255)
  12. end
  13. ------------------------------------------------------------
  14. pcall(function() char.Suit:remove() end)
  15. wait()
  16. plyr = Player
  17. lol = Instance.new("Model")
  18. lol.Parent = plyr.Character
  19. lol.Name = "Suit"
  20. function updateLooks()
  21. for i,v in pairs(plyr.Character:getChildren()) do
  22. if v:IsA("Part") then
  23. v.Reflectance = 0.1
  24. v.TopSurface = "Smooth"
  25. v.BottomSurface = "Smooth"
  26. v.LeftSurface = "Smooth"
  27. v.RightSurface = "Smooth"
  28. v.BrickColor = BrickColor.new("Bright yellow")
  29. v.Reflectance = 0.2
  30.  
  31. elseif v:IsA("Hat") then
  32. v:Remove()
  33. elseif v:IsA("Shirt") then
  34. v:Remove()
  35. elseif v:IsA("Pants") then
  36. v:Remove()
  37. end
  38. end
  39. pcall(function()
  40. plyr.Character.Torso.roblox:Remove()
  41. plyr.Character["Shirt Graphic"]:Remove()
  42. end)
  43. local v = Instance.new("Shirt", char)
  44. v.ShirtTemplate = "http://www.roblox.com/asset/?id=2348001"
  45. local v = Instance.new("Pants", char)
  46. v.PantsTemplate = "http://www.roblox.com/asset/?id=2348010"
  47. end
  48. updateLooks()
  49. --Head-----------------------------
  50. hd = Instance.new("Part")
  51. hd.Parent = lol
  52. hd.CanCollide = false
  53. hd.Locked = true
  54. hd.Size = Vector3.new(1,1,1)
  55. hd.formFactor = "Symmetric"
  56. hd.CFrame = CFrame.new(3,3,0)
  57. hd.BrickColor = BrickColor.new("")
  58. m = Instance.new("SpecialMesh")
  59. m.Parent = hd
  60. m.MeshType = "FileMesh"
  61. --m.MeshId =
  62. --m.TextureId =
  63. m.Scale = Vector3.new(1.05, 1.05, 1.05)
  64. local Weld = Instance.new("Weld")
  65. Weld.Parent = hd
  66. Weld.Part0 = hd
  67. Weld.Part1 = plyr.Character.Head
  68. Weld.C0 = CFrame.new(0,-0.10,0)*CFrame.Angles(0,0,0)
  69. -- Cheese Hat--
  70. local _Part = Instance.new("Part", lol)
  71. _Part.Name = "Cheese hat"
  72. _Part.TopSurface = "Smooth"
  73. _Part.BottomSurface = "Smooth"
  74. _Part.Locked = true
  75. _Part.formFactor = "Custom"
  76. _Part.BrickColor = BrickColor.new("Bright yellow")
  77. _Part.Size = Vector3.new(3,3,3)
  78. local mesh = Instance.new("SpecialMesh", _Part)
  79. mesh.Scale = Vector3.new(2,2,2)
  80. mesh.MeshId = "http://www.roblox.com/asset/?id=1090700"
  81. local Weld = Instance.new("Weld")
  82. Weld.Parent = _Part
  83. Weld.Part0 = _Part
  84. Weld.Part1 = plyr.Character.Head
  85. Weld.C0 = CFrame.new(0,-1,0)*CFrame.Angles(0,0,0)
  86. cheese = _Part --:P
  87. --Edit-------------------------------
  88. plyr.Character.Humanoid.MaxHealth = math.huge
  89. f = Instance.new("Fire")
  90. f.Parent = plyr.Character.Torso
  91. --f.Color = Color3.new(5,0,5)--OLD C
  92. f.Color = BrickColor.new("Bright yellow").Color
  93. f.Size = 5
  94. --WalkSpeed--------------------
  95. plyr.Character.Humanoid.WalkSpeed = 50
  96. ----------------------Functions-----------------------------
  97. function raycast(origin, ending, ang)
  98. local ray = Ray.new(
  99. origin.p, -- origin
  100. (ending.p - origin.p).unit * 500 -- direction
  101. )
  102. local hit, Position = game.Workspace:FindPartOnRay(ray, ang)
  103. local RayPart = Instance.new("Part", game.Workspace)
  104. RayPart.Name = "RayPart"
  105. RayPart.BrickColor = BrickColor.new("Bright yellow")
  106. RayPart.Transparency = 0.5
  107. RayPart.Anchored = true
  108. RayPart.CanCollide = false
  109. RayPart.TopSurface = Enum.SurfaceType.Smooth
  110. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  111. RayPart.formFactor = Enum.FormFactor.Custom
  112. local Distance = (Position-origin.p).magnitude
  113. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  114. RayPart.CFrame = CFrame.new(Position,origin.p) * CFrame.new(0,0,-Distance/2)
  115. game.Debris:AddItem(RayPart,0.1)
  116. return hit
  117. end
  118. function onDied()
  119. wait(4.9)
  120. if script.Parent.Parent == nil then return end
  121. script.Parent.Parent = nil
  122. wait(0.1)
  123. script.Parent = Player.Backpack
  124. Player.Character.Humanoid.Died:connect(onDied)
  125. end
  126. function SetAngle(Joint, Angle, Character)
  127. if Character == nil then return false end
  128. local Joints = {
  129. Character.Torso:FindFirstChild("Right Shoulder 2"),
  130. Character.Torso:FindFirstChild("Left Shoulder 2"),
  131. Character.Torso:FindFirstChild("Right Hip 2"),
  132. Character.Torso:FindFirstChild("Left Hip 2")
  133. }
  134. if Joints[Joint] == nil then return false end
  135. if Joint == 1 or Joint == 3 then
  136. Joints[Joint].DesiredAngle = Angle
  137. end
  138. if Joint == 2 or Joint == 4 then
  139. Joints[Joint].DesiredAngle = -Angle
  140. end
  141. end
  142. function ForceAngle(Joint, Angle, Character)
  143. if Character == nil then return false end
  144. local Joints = {
  145. Character.Torso:FindFirstChild("Right Shoulder 2"),
  146. Character.Torso:FindFirstChild("Left Shoulder 2"),
  147. Character.Torso:FindFirstChild("Right Hip 2"),
  148. Character.Torso:FindFirstChild("Left Hip 2")
  149. }
  150. if Joints[Joint] == nil then return false end
  151. if Joint == 1 or Joint == 3 then
  152. Joints[Joint].DesiredAngle = Angle
  153. Joints[Joint].CurrentAngle = Angle
  154. end
  155. if Joint == 2 or Joint == 4 then
  156. Joints[Joint].DesiredAngle = -Angle
  157. Joints[Joint].CurrentAngle = -Angle
  158. end
  159. end
  160. function SetSpeed(Joint, Speed, Character)
  161. if Character == nil then return false end
  162. local Joints = {
  163. Character.Torso:FindFirstChild("Right Shoulder 2"),
  164. Character.Torso:FindFirstChild("Left Shoulder 2"),
  165. Character.Torso:FindFirstChild("Right Hip 2"),
  166. Character.Torso:FindFirstChild("Left Hip 2")
  167. }
  168. if Joints[Joint] == nil then return false end
  169. Joints[Joint].MaxVelocity = Speed
  170. end
  171. function DisableLimb(Limb, Character)
  172. if Character == nil then return false end
  173. if Character:FindFirstChild("Torso") == nil then return false end
  174. local Joints = {
  175. Character.Torso:FindFirstChild("Right Shoulder"),
  176. Character.Torso:FindFirstChild("Left Shoulder"),
  177. Character.Torso:FindFirstChild("Right Hip"),
  178. Character.Torso:FindFirstChild("Left Hip")
  179. }
  180. local Limbs = {
  181. Character:FindFirstChild("Right Arm"),
  182. Character:FindFirstChild("Left Arm"),
  183. Character:FindFirstChild("Right Leg"),
  184. Character:FindFirstChild("Left Leg")
  185. }
  186. if Joints[Limb] == nil then return false end
  187. if Limbs[Limb] == nil then return false end
  188. local Joint = Instance.new("Motor")
  189. Joint.Parent = Character.Torso
  190. Joint.Part0 = Character.Torso
  191. Joint.Part1 = Limbs[Limb]
  192. if Limb == 1 then
  193. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  194. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  195. Joint.Name = "Right Shoulder 2"
  196. elseif Limb == 2 then
  197. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  198. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  199. Joint.Name = "Left Shoulder 2"
  200. elseif Limb == 3 then
  201. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  202. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  203. Joint.Name = "Right Hip 2"
  204. elseif Limb == 4 then
  205. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  206. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  207. Joint.Name = "Left Hip 2"
  208. end
  209. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  210. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  211. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  212. Joints[Limb]:Remove()
  213. end
  214. function ResetLimbCFrame(Limb, Character)
  215. if Character == nil then return false end
  216. if Character.Parent == nil then return false end
  217. if Character:FindFirstChild("Torso") == nil then return false end
  218. local Joints = {
  219. Character.Torso:FindFirstChild("Right Shoulder 2"),
  220. Character.Torso:FindFirstChild("Left Shoulder 2"),
  221. Character.Torso:FindFirstChild("Right Hip 2"),
  222. Character.Torso:FindFirstChild("Left Hip 2")
  223. }
  224. local Limbs = {
  225. Character:FindFirstChild("Right Arm"),
  226. Character:FindFirstChild("Left Arm"),
  227. Character:FindFirstChild("Right Leg"),
  228. Character:FindFirstChild("Left Leg")
  229. }
  230. if Joints[Limb] == nil then return false end
  231. if Limbs[Limb] == nil then return false end
  232. if Limb == 1 then
  233. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  234. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  235. elseif Limb == 2 then
  236. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  237. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  238. elseif Limb == 3 then
  239. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  240. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  241. elseif Limb == 4 then
  242. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  243. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  244. end
  245. end
  246. function EnableLimb(Limb, Character)
  247. if Character == nil then return false end
  248. if Character:FindFirstChild("Torso") == nil then return false end
  249. local Joints = {
  250. Character.Torso:FindFirstChild("Right Shoulder 2"),
  251. Character.Torso:FindFirstChild("Left Shoulder 2"),
  252. Character.Torso:FindFirstChild("Right Hip 2"),
  253. Character.Torso:FindFirstChild("Left Hip 2")
  254. }
  255. local Limbs = {
  256. Character:FindFirstChild("Right Arm"),
  257. Character:FindFirstChild("Left Arm"),
  258. Character:FindFirstChild("Right Leg"),
  259. Character:FindFirstChild("Left Leg")
  260. }
  261. if Joints[Limb] == nil then return false end
  262. if Limbs[Limb] == nil then return false end
  263. if Limb == 1 then
  264. Joints[Limb].Name = "Right Shoulder"
  265. elseif Limb == 2 then
  266. Joints[Limb].Name = "Left Shoulder"
  267. elseif Limb == 3 then
  268. Joints[Limb].Name = "Right Hip"
  269. elseif Limb == 4 then
  270. Joints[Limb].Name = "Left Hip"
  271. end
  272. Animate = Character:FindFirstChild("Animate")
  273. if Animate == nil then return false end
  274. Animate = Animate:Clone()
  275. Character.Animate:Remove()
  276. Animate.Parent = Character
  277. end
  278. function Weld(x, y)
  279. weld = Instance.new("Weld")
  280. weld.Part0 = x
  281. weld.Part1 = y
  282. CJ = CFrame.new(x.Position)
  283. C0 = x.CFrame:inverse() * CJ
  284. C1 = y.CFrame:inverse() * CJ
  285. weld.C0 = C0
  286. weld.C1 = C1
  287. weld.Parent = x
  288. end
  289. ---------------------
  290. function tagHumanoid(humanoid) local tag = Instance.new("ObjectValue") tag.Name = "creator" tag.Value = Player tag.Parent = humanoid end function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:FindFirstChild("creator") if tag ~= nil then tag:Remove() end end end
  291. -------------------------------------------------------------------------------------------
  292. function onButton1Down(mouse)
  293. if(mode1 == "Cheese hat")then
  294. if(mode2 == "cheeseray")then
  295. local hit = raycast(cheese.CFrame, mouse.Hit, plyr.Character)
  296. if(hit)then
  297. hit.BrickColor = BrickColor.new("Bright yellow")
  298. local mesh = Instance.new("SpecialMesh", hit)
  299. mesh.Scale = hit.Size
  300. mesh.MeshId = "http://www.roblox.com/asset/?id=1090700"
  301. end
  302. busy = false
  303. elseif mode2 == "Throw" then
  304. if(not busy)then
  305. --[[busy = true]]
  306. DisableLimb(1, char)
  307. SetSpeed(1, .5, char)
  308. SetAngle(1, math.rad(180), char)
  309. wait(0.2)
  310. local _Part = Instance.new("Part", lol)
  311. _Part.Name = "Cheese hat"
  312. _Part.TopSurface = "Smooth"
  313. _Part.BottomSurface = "Smooth"
  314. _Part.Locked = true
  315. _Part.formFactor = "Custom"
  316. _Part.BrickColor = BrickColor.new("Bright yellow")
  317. _Part.Size = Vector3.new(1,1,1)
  318. local mesh = Instance.new("SpecialMesh", _Part)
  319. mesh.Scale = Vector3.new(0.5,0.5,0.5)
  320. mesh.MeshId = "http://www.roblox.com/asset/?id=1090700"
  321. local Weld = Instance.new("Weld")
  322. Weld.Parent = _Part
  323. Weld.Part0 = _Part
  324. Weld.Part1 = char["Right Arm"]
  325. Weld.C0 = CFrame.new(0,1,0)
  326. wait(0.2)
  327. SetSpeed(1, .5, char)
  328. SetAngle(1, math.rad(90), char)
  329. local bp = Instance.new("BodyPosition", _Part)
  330. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  331. bp.position = mouse.Hit.p
  332. _Part.Weld:remove()
  333. _Part.Touched:connect(function(m)
  334. if(m.Parent:FindFirstChild("Humanoid") and not m.Parent == char)then
  335. m.Parent.Humanoid:TakeDamage(30)
  336. _Part:remove()
  337. end
  338. end)
  339. EnableLimb(1, char)
  340. wait(4)
  341. _Part:remove()
  342. end
  343. end
  344. end
  345. end
  346. function onMouseMove(mouse)
  347.  
  348. end
  349. function onButton1Up(mouse)
  350.  
  351. end
  352. function onKeyDown(key, mouse)
  353. key = key:lower()
  354. if mode1 == "nothing" then
  355. if key == "z" then
  356. mode1 = "Cheese hat"
  357. mode2 = "nothing"
  358. elseif key == "x" then
  359. mode1 = "Staff"
  360. mode2 = "nothing"
  361. --Staff showing animation TO DO
  362. end
  363. else
  364. if key == "z" and mode1 == "Cheese hat" then
  365. mode1 = "nothing"
  366. mode2 = "nothing"
  367. elseif key == "x" and mode1 == "Staff" then
  368. mode1 = "nothing"
  369. mode2 = "nothing"
  370. --Staff hiding animation TO DO
  371. else
  372. ---------------DO STUFF :3------------------
  373. if mode1 == "Cheese hat" then
  374. --mod1
  375. if(key == "q")then
  376. if(mode2 == "nothing") then
  377. mode2 = "cheeseray"
  378. elseif mode2 == "cheeseray" then
  379. mode2 = "nothing"
  380. end
  381. elseif key == "e" then
  382. if(mode2 == "nothing") then
  383. mode2 = "Throw"
  384. elseif mode2 == "Throw" then
  385. mode2 = "nothing"
  386. end
  387. end
  388. elseif mode1 == "Staff" then
  389. --mod2 --Staff --To do
  390. end
  391. end
  392. end
  393. end
  394. ----------------------------------------------Connectors-----------------------------------
  395. isgui = true
  396. function showgui()
  397. isgui = true
  398. --Status GUI--
  399. local g = Instance.new("ScreenGui", plyr.PlayerGui)
  400. g.Name = "CheeseSuitStatusGUI"
  401. local t = Instance.new("TextLabel", g)
  402. t.Position = UDim2.new(0, 300, 1, -50)
  403. t.Size = UDim2.new(0, 250, 0, 50)
  404. t.Text = mode1 .. ":" .. mode2
  405. t.FontSize = "Size14"
  406. t.Name = "p"
  407. Spawn(function()
  408. while isgui do
  409. if(isgui)then
  410. pcall(function()
  411. plyr.PlayerGui.CheeseSuitStatusGUI.p.Text = mode1 .. ":" .. mode2
  412. end)
  413. end
  414. wait(0.5)
  415. end
  416. end)
  417. end
  418. function hidegui()
  419. isgui = false
  420. pcall(function() plyr.PlayerGui.CheeseSuitStatusGUI:remove() end)
  421. end
  422. function onSelected(mouse)
  423. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  424. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  425. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  426. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  427. mouse.Move:connect(function() onMouseMove(mouse) end)
  428. showgui()
  429. end
  430. function onDeselected(mouse)
  431. --To do
  432. hidegui()
  433. end
  434. if script.Parent.ClassName ~= "HopperBin" then
  435. if Player == nil then print("Error: Player not found!") return end
  436. Tool = Instance.new("HopperBin")
  437. Tool.Name = "Suit Control"
  438. Tool.Parent = Player.Backpack
  439. script.Name = "Main"
  440. script.Parent = Tool
  441. Player.Character.Humanoid.Died:connect(onDied)
  442. elseif script.Parent.ClassName == "HopperBin" then
  443. Player = script.Parent.Parent.Parent
  444. script.Parent.Selected:connect(onSelected)
  445. script.Parent.Deselected:connect(onDeselected)
  446. end
Advertisement
Add Comment
Please, Sign In to add comment