Mdbook

Untitled

Mar 6th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.86 KB | None | 0 0
  1. --uncomment the following if script doesnt work
  2. --script/
  3. PLAYERS = game:GetService('Players')
  4. ply = PLAYERS.YOURNAMEHERE
  5. char = ply.Character
  6. torso = char.Torso
  7. pcall(function() Workspace:FindFirstChild("Pacghost"):Remove() end)
  8. m = Instance.new("Model",Workspace) m.Name = "Pacghost"
  9. script.Parent = m
  10. debris = game:GetService("Debris")
  11. cfn,ang,v3n,ud2n,V2 = CFrame.new,CFrame.Angles,Vector3.new,UDim2.new,Vector2.new
  12. for i = 0,1 do --------UTILITIES START-------
  13. function genNew(ClassName, Parent, Properties)
  14. local nObj = Instance.new(ClassName, Parent)
  15. if Properties["FormFactor"] then
  16. nObj["FormFactor"] = Properties["FormFactor"]
  17. end
  18. for Prop, Value in pairs(Properties) do
  19. nObj[Prop] = Value
  20. end
  21. return nObj
  22. end
  23.  
  24. T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee)
  25. if typee == 'wedge' then
  26. c = Instance.new("WedgePart",m)
  27. elseif typee == 'seat' then
  28. c = Instance.new("Seat",m)
  29. elseif typee == 'vseat' then
  30. c = Instance.new("VehicleSeat",m)
  31. else
  32. c = Instance.new("Part",m)
  33. end
  34. c.TopSurface,c.BottomSurface = 0,0
  35. c.Locked = true
  36. c.formFactor = "Custom"
  37. c.Size = Vector3.new(x,y,z)
  38. if color ~= "random" then
  39. c.BrickColor = BrickColor.new(color)
  40. else c.BrickColor = BrickColor:random()
  41. end
  42. c.Transparency = transparency
  43. c.CanCollide = cancollide
  44. if anchored ~= nil then c.Anchored = anchored end
  45. if parent ~= nil then c.Parent = parent end
  46. return c
  47. end
  48. ,
  49. ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
  50. ,
  51. ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent)
  52. w = Instance.new("Motor",m)
  53. if parent ~= nil then w.Parent = parent end
  54. w.Part0,w.Part1 = part0,part1
  55. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
  56. return w
  57. end
  58. ,
  59. ["BG"] = function(parent)
  60. local c = Instance.new("BodyGyro",parent)
  61. c.P = 20e+003
  62. c.cframe = parent.CFrame
  63. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  64. return c
  65. end
  66. ,
  67. ["BP"] = function(parent,position)
  68. local bp = Instance.new("BodyPosition",parent)
  69. bp.maxForce = Vector3.new()*math.huge
  70. bp.position = position
  71. return bp
  72. end
  73. ,
  74. ["F"] = function(parent,size,heat,color,secondcolor,enabled)
  75. f = Instance.new("Fire",parent)
  76. f.Size = size
  77. f.Heat = heat
  78. if enabled ~= nil then f.Enabled = enabled end
  79. if color ~= nil then f.Color = BrickColor.new(color).Color end
  80. if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
  81. return f
  82. end
  83. ,
  84.  
  85. ["FM"] = function(parent,meshid,x,y,z,meshtexture)
  86. if meshid == "cylinder" then
  87. mesh = Instance.new("CylinderMesh",parent)
  88. mesh.Scale = Vector3.new(x,y,z)
  89. return mesh
  90. elseif meshid == 'block' then
  91. mesh = Instance.new("SpecialMesh",parent)
  92. mesh.MeshId = 'rbxassetid://9856898'
  93. mesh.Scale = v3n(x*parent.Size.x,y*parent.Size.y,z*parent.Size.z)*2
  94. if meshtexture then mesh.TextureId = 'rbxassetid://'..textureids[meshtexture] end
  95. return mesh
  96. end
  97. mesh = Instance.new("SpecialMesh",parent)
  98.  
  99. if meshid == 'wedge' then
  100. mesh.MeshType = 'Wedge'
  101. elseif meshid == 'sphere' then
  102. mesh.MeshType = 3
  103. elseif type(meshid) == "number" then
  104. mesh.MeshId = "rbxassetid://"..meshid
  105. else
  106. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  107. end
  108. mesh.Scale = Vector3.new(x,y,z)
  109. if meshtexture then
  110. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  111. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  112. end
  113. return mesh
  114. end,
  115.  
  116. ["Dec"] = function(parent,face,id,transparency)
  117. c = Instance.new("Decal",parent)
  118. c.Face = face
  119. c.Texture = id
  120. if transparency then c.Transparency = transparency end
  121. return c
  122. end,
  123. ["S"] = function(id,pitch,volume,parent) --- SOUND FUNCTION
  124. cur = nil
  125. found = false
  126. if type(id) == 'string' then
  127. for i,v in pairs(char.Head:children()) do
  128. if v:IsA("Sound") and v.Name == id and not found then
  129. cur = v
  130. if parent then cur = v:Clone() cur.Parent = parent end
  131. cur.Pitch = pitch
  132. if volume then cur.Volume = volume end
  133. cur:Play()
  134. found = true
  135. return cur
  136. end
  137. end
  138. elseif type(id) == 'number' then
  139. local a = char.Head:FindFirstChild('exteo')
  140. a.SoundId = 'rbxassetid://'..id
  141. a.Pitch = pitch
  142. if volume then a.Volume = volume end
  143. a:Play()
  144. return a
  145. end
  146. end
  147. }
  148.  
  149.  
  150. M = {["R"] = function(a,b) return math.random(a,b) end,
  151. ["Cos"] = function(a) return math.cos(a) end,
  152. ["Sin"] = function(a) return math.sin(a) end,
  153. ["D"] = function(a) return math.rad(a) end
  154. }
  155.  
  156. function FindHumanoid(a,b)
  157. for i,v in pairs(a:children()) do
  158. if v:IsA('Humanoid') then
  159. if not b then
  160. if v.Parent ~= char then return v end
  161. else return v end
  162. end
  163. end
  164. end
  165. function damage(hit,amount,delay) ---- VAHINKO DAMAGE
  166. hum = FindHumanoid(hit)
  167. if hum then
  168. if delay then
  169. local found = CheckTag(hum,'tag')
  170. if not found then
  171. local a = AddTag(hum,'tag')
  172. debris:AddItem(a,delay)
  173. hum.Health = hum.Health - amount
  174. end
  175. else hum.Health = hum.Health - amount
  176. end
  177. return hum
  178. end
  179. end
  180.  
  181. rtorso = torso
  182.  
  183. lock = {["R"] =
  184. function(a)
  185. if a == 1 then
  186. rabrick = T.P(1.1,1.1,1.1,"White",1,false,false)
  187. rw = T.W(rabrick,rtorso,1.5,.5,0,0,0,0)
  188. T.W(rarm,rabrick,0,-.5,0,0,0,0)
  189. elseif a == 2 then
  190. rlbrick = T.P(1,1,1,"White",1,false,false)
  191. rhw = T.W(rlbrick,rtorso,.5,-1.5,0,0,0,0)
  192. T.W(rleg,rlbrick,0,-.5,0,0,0,0)
  193. elseif a == 0 then
  194. rs.Parent = rtorso
  195. rw.Parent = nil
  196. rabrick:Destroy() rabrick = nil
  197. elseif a == -1 then
  198. rhw.Parent = nil
  199. rh.Parent = rtorso
  200. rlbrick:Destroy() rlbrick = nil
  201. end
  202. end
  203. , ["L"] = function(a)
  204. if a == 1 then
  205. labrick = T.P(1,1,1,"White",1,false,false)
  206. lw = T.W(labrick,rtorso,-1.5,.5,0,0,0,0)
  207. T.W(larm,labrick,0,-.5,0,0,0,0)
  208. elseif a == 2 then
  209. llbrick = T.P(1,1,1,"White",1,false,false)
  210. lhw = T.W(llbrick,rtorso,-.5,-1.5,0,0,0,0)
  211. T.W(lleg,llbrick,0,-.5,0,0,0,0)
  212. elseif a == 0 then
  213. ls.Parent = rtorso
  214. lw.Parent = nil
  215. labrick:Destroy() labrick = nil
  216. elseif a == -1 then
  217. lhw.Parent = nil
  218. lh.Parent = rtorso
  219. llbrick:Destroy() llbrick = nil
  220. end
  221. end
  222. }
  223.  
  224. cfn,ang = CFrame.new,CFrame.Angles
  225. function spaas(position,radius,number,number2,color)
  226. mode = Instance.new("Model",m)
  227.  
  228. for i = 1,number2 do
  229. pos = position+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  230. mag = (position-pos).magnitude
  231.  
  232. col = color or 'Toothpaste'
  233. local laz = T.P(.1,mag,.1,col,0,false,true,mode)
  234.  
  235. T.FM(laz,'cylinder',.3,1,.3)
  236. laz.CFrame = (cfn(position,pos)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  237.  
  238. cframe = (laz.CFrame*cfn(0,-mag/2,0)).p
  239. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  240. mag2 = (cframe-pos2).magnitude
  241. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  242. T.FM(laz2,'cylinder',.3,1,.3)
  243. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  244.  
  245. previo = laz2
  246. for i = 1,number do
  247. cframe = (previo.CFrame*cfn(0,-mag/2,0)).p
  248. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  249. mag2 = (cframe-pos2).magnitude
  250.  
  251. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  252. T.FM(laz2,'cylinder',.3,1,.3)
  253. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  254.  
  255. previo = laz2
  256. end
  257.  
  258. end
  259. debris:AddItem(mode,.1)
  260. return mode
  261. end
  262.  
  263. function lightning(startpos,endpos,times,offse,livetime,col,dmg)
  264. local curpos = startpos
  265. for i = 1,times do
  266. mag = (startpos-endpos).magnitude offs = {-offse,offse}
  267. offset = v3n(offs[M.R(1,2)],offs[M.R(1,2)],offs[M.R(1,2)])
  268. laz = T.P(.1,.1,mag/times,col,0,false,true,m)
  269. if dmg then laz.Touched:connect(function(hit) damage(hit.Parent,dmg[1],dmg[2]) end) end
  270. apos = (cfn(curpos,endpos)*cfn(0,0,-mag/times)).p+offset
  271. if times == i then
  272. mag2 = (curpos-endpos).magnitude
  273. laz.Size = v3n(.1,.1,mag2)
  274. laz.CFrame = cfn(curpos,endpos)*cfn(0,0,-mag2/2)
  275. else
  276. laz.CFrame = cfn(curpos,apos)*cfn(0,0,-mag/times/2)
  277. end
  278. curpos = laz.CFrame*cfn(0,0,-mag/times/2).p debris:AddItem(laz,livetime)
  279. end
  280. end
  281.  
  282. ------MESHIDS---
  283. meshids = {["penguin"] = 15853464, ["ring"] = 3270017,
  284. ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
  285. ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
  286. ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557,
  287. ["ramen"] = 19380188,["lightning"] = 72583597,["bullet"]=2697549,['cheese'] = 1090700,["pan"] = 24342877,["ketchup"] = 29690481,
  288. ["duck"] = 9419831,["unicorn"]=84003494,["luatophat"] = 42157240}---some meshids
  289. textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153,
  290. ["cheese"] = 1090703}
  291. soundids = {["bell"] = 20005706,["flintlock"] = 13510352,["falcon"] = 1387390,['sensa'] = 4700455,
  292. ['midas'] = 17385513;
  293. ['spark'] = 10756118;
  294. ['boom'] = 10730819;
  295. ['plank'] = 10548112;
  296. ['harmonica1'] = 33069371;
  297. ['harmonica2'] = 33069412;
  298. ['thump'] = 10730819;
  299. ['hit'] = 2801263;
  300. ['crunch'] = 15047813;
  301. ['Piano'] = 11998796;
  302. ['machinegun'] = 2691591;
  303. }
  304. end
  305.  
  306. pcall(function() char.Head.face:Remove() end)
  307. function ventta(moto)
  308. while moto.DesiredAngle ~= moto.CurrentAngle do wait() end
  309. end
  310. p = T.P(5,2,5,'Brown',0,false,false) T.FM(p,'cylinder',1,1.5,1)
  311. p.Name = 'Torso' p.Position = v3n(70,0,0)
  312.  
  313. p2 = T.P(1,1,1,'Brown',0,false,false) T.FM(p2,'cylinder',5,2,5)
  314. motor = T.W(p2,p,0,1.7,2.5,0,-math.pi/2,0,p2)
  315. motor.C0 = cfn(0,-.35,-2.5)*ang(0,math.pi/2,0)
  316. motor.MaxVelocity = .1
  317.  
  318. p3 = T.P(1,1,1,'New Yeller',0,false,false) T.FM(p3,'sphere',5,4,5)
  319. T.W(p3,p2,0,1.2,0,0,0,0) p2.Name = 'Head'
  320.  
  321. human = Instance.new("Humanoid",m)
  322.  
  323. r = 2
  324. for i = -30,180+30,30 do
  325. pp = T.P(.5,.5,.75,'White',0,false,false)
  326. T.W(pp,p2,M.Cos(M.D(i))*r,-1.375,M.Sin(M.D(i))*r,math.pi/2,0,-math.pi/2+M.D(i))
  327. end
  328.  
  329. eye = T.P(1,1,1,'Lime green',0,false,false) T.FM(eye,'cylinder',scale,scale,scale)
  330. T.W(eye,p2,0,.5,2,math.pi/2,0,0)
  331.  
  332. function l(a,x,y,z,b)
  333. if b == nil then
  334. return a.CFrame*cfn(x,y,z)
  335. else
  336. return a*cfn(x,y,z)
  337. end
  338. end
  339.  
  340. pcall(function() m.Stomach:Remove() end)
  341. box = Instance.new("Model",m) box.Name = 'Stomach'
  342. floro = T.P(30,1,30,'Pink',0,true,true,box)
  343. floro.CFrame = cfn(-50,600,0)
  344. wall1 = T.P(30,20,0,'Pink',0,true,true,box)
  345. wall1.CFrame = l(floro,-15,10.5,0)*ang(0,math.pi/2,0)
  346. wall1 = T.P(30,20,0,'Pink',0,true,true,box)
  347. wall1.CFrame = l(floro,15,10.5,0)*ang(0,math.pi/2,0)
  348. wall1 = T.P(30,20,0,'Pink',0,true,true,box)
  349. wall1.CFrame = l(floro,0,10.5,-15)
  350. wall1 = T.P(30,20,0,'Pink',0,true,true,box)
  351. wall1.CFrame = l(floro,0,10.5,15)
  352. top = T.P(30,1,30,'Pink',0,true,true,box)
  353. top.CFrame = l(floro,0,20.5,0)
  354.  
  355. function FindPlayers(a,b) --- Finds Players near a part
  356. list = {}
  357. for i,v in pairs(Workspace:children()) do
  358. if v:IsA("Model") and v.Name ~= m.Name then
  359. for _,q in pairs(v:children()) do
  360. if q:IsA("Humanoid") then
  361. if q.Health > 0 and q.Torso ~= nil then
  362. if (q.Torso.Position-a).magnitude < b then
  363. table.insert(list,v)
  364. end
  365. end
  366. end
  367. end
  368. end
  369. end
  370. return list
  371. end
  372.  
  373. p.Touched:connect(function(hit)
  374. local hum = hit.Parent:FindFirstChild("Humanoid")
  375. if hum then hum.Torso.CFrame = l(floro,0,3,0) end
  376. end)
  377.  
  378. function lazer(startp,endp,color)
  379. local mag = (startp-endp).magnitude
  380. local laz = T.P(3,mag,.3,color,.5,false,true,Workspace)
  381. laz.CFrame = (cfn(startp,endp)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  382. debris:AddItem(laz,1)
  383. return (cfn(startp,endp)*cfn(0,0,-mag/2))
  384. end
  385.  
  386.  
  387. while wait(1) do
  388. local found = FindPlayers(p.Position,30)
  389. if #found > 0 then motor.DesiredAngle = -1
  390. human:MoveTo(found[M.R(1,#found)].Torso.Position,Workspace.Base,'')
  391. else motor.DesiredAngle = 0 end
  392. end
Add Comment
Please, Sign In to add comment