Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --uncomment the following if script doesnt work
- --script/
- PLAYERS = game:GetService('Players')
- ply = PLAYERS.YOURNAMEHERE
- char = ply.Character
- torso = char.Torso
- pcall(function() Workspace:FindFirstChild("Pacghost"):Remove() end)
- m = Instance.new("Model",Workspace) m.Name = "Pacghost"
- script.Parent = m
- debris = game:GetService("Debris")
- cfn,ang,v3n,ud2n,V2 = CFrame.new,CFrame.Angles,Vector3.new,UDim2.new,Vector2.new
- for i = 0,1 do --------UTILITIES START-------
- function genNew(ClassName, Parent, Properties)
- local nObj = Instance.new(ClassName, Parent)
- if Properties["FormFactor"] then
- nObj["FormFactor"] = Properties["FormFactor"]
- end
- for Prop, Value in pairs(Properties) do
- nObj[Prop] = Value
- end
- return nObj
- end
- T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee)
- if typee == 'wedge' then
- c = Instance.new("WedgePart",m)
- elseif typee == 'seat' then
- c = Instance.new("Seat",m)
- elseif typee == 'vseat' then
- c = Instance.new("VehicleSeat",m)
- else
- c = Instance.new("Part",m)
- end
- c.TopSurface,c.BottomSurface = 0,0
- c.Locked = true
- c.formFactor = "Custom"
- c.Size = Vector3.new(x,y,z)
- if color ~= "random" then
- c.BrickColor = BrickColor.new(color)
- else c.BrickColor = BrickColor:random()
- end
- c.Transparency = transparency
- c.CanCollide = cancollide
- if anchored ~= nil then c.Anchored = anchored end
- if parent ~= nil then c.Parent = parent end
- return c
- end
- ,
- ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
- ,
- ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent)
- w = Instance.new("Motor",m)
- if parent ~= nil then w.Parent = parent end
- w.Part0,w.Part1 = part0,part1
- w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
- return w
- end
- ,
- ["BG"] = function(parent)
- local c = Instance.new("BodyGyro",parent)
- c.P = 20e+003
- c.cframe = parent.CFrame
- c.maxTorque = Vector3.new(c.P,c.P,c.P)
- return c
- end
- ,
- ["BP"] = function(parent,position)
- local bp = Instance.new("BodyPosition",parent)
- bp.maxForce = Vector3.new()*math.huge
- bp.position = position
- return bp
- end
- ,
- ["F"] = function(parent,size,heat,color,secondcolor,enabled)
- f = Instance.new("Fire",parent)
- f.Size = size
- f.Heat = heat
- if enabled ~= nil then f.Enabled = enabled end
- if color ~= nil then f.Color = BrickColor.new(color).Color end
- if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
- return f
- end
- ,
- ["FM"] = function(parent,meshid,x,y,z,meshtexture)
- if meshid == "cylinder" then
- mesh = Instance.new("CylinderMesh",parent)
- mesh.Scale = Vector3.new(x,y,z)
- return mesh
- elseif meshid == 'block' then
- mesh = Instance.new("SpecialMesh",parent)
- mesh.MeshId = 'rbxassetid://9856898'
- mesh.Scale = v3n(x*parent.Size.x,y*parent.Size.y,z*parent.Size.z)*2
- if meshtexture then mesh.TextureId = 'rbxassetid://'..textureids[meshtexture] end
- return mesh
- end
- mesh = Instance.new("SpecialMesh",parent)
- if meshid == 'wedge' then
- mesh.MeshType = 'Wedge'
- elseif meshid == 'sphere' then
- mesh.MeshType = 3
- elseif type(meshid) == "number" then
- mesh.MeshId = "rbxassetid://"..meshid
- else
- mesh.MeshId = "rbxassetid://"..meshids[meshid]
- end
- mesh.Scale = Vector3.new(x,y,z)
- if meshtexture then
- if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
- mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
- end
- return mesh
- end,
- ["Dec"] = function(parent,face,id,transparency)
- c = Instance.new("Decal",parent)
- c.Face = face
- c.Texture = id
- if transparency then c.Transparency = transparency end
- return c
- end,
- ["S"] = function(id,pitch,volume,parent) --- SOUND FUNCTION
- cur = nil
- found = false
- if type(id) == 'string' then
- for i,v in pairs(char.Head:children()) do
- if v:IsA("Sound") and v.Name == id and not found then
- cur = v
- if parent then cur = v:Clone() cur.Parent = parent end
- cur.Pitch = pitch
- if volume then cur.Volume = volume end
- cur:Play()
- found = true
- return cur
- end
- end
- elseif type(id) == 'number' then
- local a = char.Head:FindFirstChild('exteo')
- a.SoundId = 'rbxassetid://'..id
- a.Pitch = pitch
- if volume then a.Volume = volume end
- a:Play()
- return a
- end
- end
- }
- M = {["R"] = function(a,b) return math.random(a,b) end,
- ["Cos"] = function(a) return math.cos(a) end,
- ["Sin"] = function(a) return math.sin(a) end,
- ["D"] = function(a) return math.rad(a) end
- }
- function FindHumanoid(a,b)
- for i,v in pairs(a:children()) do
- if v:IsA('Humanoid') then
- if not b then
- if v.Parent ~= char then return v end
- else return v end
- end
- end
- end
- function damage(hit,amount,delay) ---- VAHINKO DAMAGE
- hum = FindHumanoid(hit)
- if hum then
- if delay then
- local found = CheckTag(hum,'tag')
- if not found then
- local a = AddTag(hum,'tag')
- debris:AddItem(a,delay)
- hum.Health = hum.Health - amount
- end
- else hum.Health = hum.Health - amount
- end
- return hum
- end
- end
- rtorso = torso
- lock = {["R"] =
- function(a)
- if a == 1 then
- rabrick = T.P(1.1,1.1,1.1,"White",1,false,false)
- rw = T.W(rabrick,rtorso,1.5,.5,0,0,0,0)
- T.W(rarm,rabrick,0,-.5,0,0,0,0)
- elseif a == 2 then
- rlbrick = T.P(1,1,1,"White",1,false,false)
- rhw = T.W(rlbrick,rtorso,.5,-1.5,0,0,0,0)
- T.W(rleg,rlbrick,0,-.5,0,0,0,0)
- elseif a == 0 then
- rs.Parent = rtorso
- rw.Parent = nil
- rabrick:Destroy() rabrick = nil
- elseif a == -1 then
- rhw.Parent = nil
- rh.Parent = rtorso
- rlbrick:Destroy() rlbrick = nil
- end
- end
- , ["L"] = function(a)
- if a == 1 then
- labrick = T.P(1,1,1,"White",1,false,false)
- lw = T.W(labrick,rtorso,-1.5,.5,0,0,0,0)
- T.W(larm,labrick,0,-.5,0,0,0,0)
- elseif a == 2 then
- llbrick = T.P(1,1,1,"White",1,false,false)
- lhw = T.W(llbrick,rtorso,-.5,-1.5,0,0,0,0)
- T.W(lleg,llbrick,0,-.5,0,0,0,0)
- elseif a == 0 then
- ls.Parent = rtorso
- lw.Parent = nil
- labrick:Destroy() labrick = nil
- elseif a == -1 then
- lhw.Parent = nil
- lh.Parent = rtorso
- llbrick:Destroy() llbrick = nil
- end
- end
- }
- cfn,ang = CFrame.new,CFrame.Angles
- function spaas(position,radius,number,number2,color)
- mode = Instance.new("Model",m)
- for i = 1,number2 do
- pos = position+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
- mag = (position-pos).magnitude
- col = color or 'Toothpaste'
- local laz = T.P(.1,mag,.1,col,0,false,true,mode)
- T.FM(laz,'cylinder',.3,1,.3)
- laz.CFrame = (cfn(position,pos)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
- cframe = (laz.CFrame*cfn(0,-mag/2,0)).p
- pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
- mag2 = (cframe-pos2).magnitude
- local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
- T.FM(laz2,'cylinder',.3,1,.3)
- laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
- previo = laz2
- for i = 1,number do
- cframe = (previo.CFrame*cfn(0,-mag/2,0)).p
- pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
- mag2 = (cframe-pos2).magnitude
- local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
- T.FM(laz2,'cylinder',.3,1,.3)
- laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
- previo = laz2
- end
- end
- debris:AddItem(mode,.1)
- return mode
- end
- function lightning(startpos,endpos,times,offse,livetime,col,dmg)
- local curpos = startpos
- for i = 1,times do
- mag = (startpos-endpos).magnitude offs = {-offse,offse}
- offset = v3n(offs[M.R(1,2)],offs[M.R(1,2)],offs[M.R(1,2)])
- laz = T.P(.1,.1,mag/times,col,0,false,true,m)
- if dmg then laz.Touched:connect(function(hit) damage(hit.Parent,dmg[1],dmg[2]) end) end
- apos = (cfn(curpos,endpos)*cfn(0,0,-mag/times)).p+offset
- if times == i then
- mag2 = (curpos-endpos).magnitude
- laz.Size = v3n(.1,.1,mag2)
- laz.CFrame = cfn(curpos,endpos)*cfn(0,0,-mag2/2)
- else
- laz.CFrame = cfn(curpos,apos)*cfn(0,0,-mag/times/2)
- end
- curpos = laz.CFrame*cfn(0,0,-mag/times/2).p debris:AddItem(laz,livetime)
- end
- end
- ------MESHIDS---
- meshids = {["penguin"] = 15853464, ["ring"] = 3270017,
- ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
- ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
- ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557,
- ["ramen"] = 19380188,["lightning"] = 72583597,["bullet"]=2697549,['cheese'] = 1090700,["pan"] = 24342877,["ketchup"] = 29690481,
- ["duck"] = 9419831,["unicorn"]=84003494,["luatophat"] = 42157240}---some meshids
- textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153,
- ["cheese"] = 1090703}
- soundids = {["bell"] = 20005706,["flintlock"] = 13510352,["falcon"] = 1387390,['sensa'] = 4700455,
- ['midas'] = 17385513;
- ['spark'] = 10756118;
- ['boom'] = 10730819;
- ['plank'] = 10548112;
- ['harmonica1'] = 33069371;
- ['harmonica2'] = 33069412;
- ['thump'] = 10730819;
- ['hit'] = 2801263;
- ['crunch'] = 15047813;
- ['Piano'] = 11998796;
- ['machinegun'] = 2691591;
- }
- end
- pcall(function() char.Head.face:Remove() end)
- function ventta(moto)
- while moto.DesiredAngle ~= moto.CurrentAngle do wait() end
- end
- p = T.P(5,2,5,'Brown',0,false,false) T.FM(p,'cylinder',1,1.5,1)
- p.Name = 'Torso' p.Position = v3n(70,0,0)
- p2 = T.P(1,1,1,'Brown',0,false,false) T.FM(p2,'cylinder',5,2,5)
- motor = T.W(p2,p,0,1.7,2.5,0,-math.pi/2,0,p2)
- motor.C0 = cfn(0,-.35,-2.5)*ang(0,math.pi/2,0)
- motor.MaxVelocity = .1
- p3 = T.P(1,1,1,'New Yeller',0,false,false) T.FM(p3,'sphere',5,4,5)
- T.W(p3,p2,0,1.2,0,0,0,0) p2.Name = 'Head'
- human = Instance.new("Humanoid",m)
- r = 2
- for i = -30,180+30,30 do
- pp = T.P(.5,.5,.75,'White',0,false,false)
- 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))
- end
- eye = T.P(1,1,1,'Lime green',0,false,false) T.FM(eye,'cylinder',scale,scale,scale)
- T.W(eye,p2,0,.5,2,math.pi/2,0,0)
- function l(a,x,y,z,b)
- if b == nil then
- return a.CFrame*cfn(x,y,z)
- else
- return a*cfn(x,y,z)
- end
- end
- pcall(function() m.Stomach:Remove() end)
- box = Instance.new("Model",m) box.Name = 'Stomach'
- floro = T.P(30,1,30,'Pink',0,true,true,box)
- floro.CFrame = cfn(-50,600,0)
- wall1 = T.P(30,20,0,'Pink',0,true,true,box)
- wall1.CFrame = l(floro,-15,10.5,0)*ang(0,math.pi/2,0)
- wall1 = T.P(30,20,0,'Pink',0,true,true,box)
- wall1.CFrame = l(floro,15,10.5,0)*ang(0,math.pi/2,0)
- wall1 = T.P(30,20,0,'Pink',0,true,true,box)
- wall1.CFrame = l(floro,0,10.5,-15)
- wall1 = T.P(30,20,0,'Pink',0,true,true,box)
- wall1.CFrame = l(floro,0,10.5,15)
- top = T.P(30,1,30,'Pink',0,true,true,box)
- top.CFrame = l(floro,0,20.5,0)
- function FindPlayers(a,b) --- Finds Players near a part
- list = {}
- for i,v in pairs(Workspace:children()) do
- if v:IsA("Model") and v.Name ~= m.Name then
- for _,q in pairs(v:children()) do
- if q:IsA("Humanoid") then
- if q.Health > 0 and q.Torso ~= nil then
- if (q.Torso.Position-a).magnitude < b then
- table.insert(list,v)
- end
- end
- end
- end
- end
- end
- return list
- end
- p.Touched:connect(function(hit)
- local hum = hit.Parent:FindFirstChild("Humanoid")
- if hum then hum.Torso.CFrame = l(floro,0,3,0) end
- end)
- function lazer(startp,endp,color)
- local mag = (startp-endp).magnitude
- local laz = T.P(3,mag,.3,color,.5,false,true,Workspace)
- laz.CFrame = (cfn(startp,endp)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
- debris:AddItem(laz,1)
- return (cfn(startp,endp)*cfn(0,0,-mag/2))
- end
- while wait(1) do
- local found = FindPlayers(p.Position,30)
- if #found > 0 then motor.DesiredAngle = -1
- human:MoveTo(found[M.R(1,#found)].Torso.Position,Workspace.Base,'')
- else motor.DesiredAngle = 0 end
- end
Add Comment
Please, Sign In to add comment