Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end -- // Old(super old) script by wulfbug9.
- -- // Cheap brock-copy, made while RMDX was making his :^)
- -- // Yeaaaah, Cuddles ftw :>
- function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("Part",Parent)
- p.Name = Name
- p.FormFactor = "Custom"
- p.Size = Size
- p.Anchored = Anch
- p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)
- p.Transparency = Trans
- p.TopSurface = 0
- p.CanCollide = Can
- p.BottomSurface = 0
- p.Material = Mat
- p.Reflectance = Ref or 0
- p:BreakJoints()
- return p
- end
- function Mesh(Parent,Type,Scale,Id,Id2)
- local m = Instance.new("SpecialMesh",Parent)
- m.MeshType = Type
- m.Scale = Scale or Vector3.new(1,1,1)
- if Id then
- m.MeshId = Id
- pcall(function()m.TextureId = Id2 end)
- end
- return m
- end
- function Weld(p1,p2,c0,c1)
- local w = Instance.new("Weld",p1.Parent)
- w.Part0,w.Part1 = p1,p2
- w.C0,w.C1 = c0 or CFrame.new(),c1 or CFrame.new()
- return w
- end
- function lerp(a,b,c)
- return a+(b-a)*c
- end
- do
- local function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5/s
- return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00-m11-m22+1)
- local recip = 0.5/s
- return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
- elseif i == 1 then
- local s = math.sqrt(m11-m22-m00+1)
- local recip = 0.5/s
- return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
- elseif i == 2 then
- local s = math.sqrt(m22-m00-m11+1)
- local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
- end
- end
- end
- local function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w*xs, w*ys, w*zs
- local xx = x*xs
- local xy = x*ys
- local xz = x*zs
- local yy = y*ys
- local yz = y*zs
- local zz = z*zs
- return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
- end
- local function QuaternionSlerp(a, b, t)
- local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((1-t)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = 1-t
- finishInterp = t
- end
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((t-1)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = t-1
- finishInterp = t
- end
- end
- return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
- end
- function clerp(a,b,t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1-t
- return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
- end
- end
- ---------------------------------------------
- player = game:service("Players").LocalPlayer
- local char
- repeat wait() char = player.Character until char
- root = char:WaitForChild("HumanoidRootPart")
- mouse = player:GetMouse()
- step = game:service("RunService").Stepped
- Mode = ""
- Attacking = false
- CurAttack = ""
- asset = "http://www.roblox.com/asset/?id="
- meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
- sounds = {["gun"] = 131070686;}--
- parts = {}
- Dead = false
- Down = false
- Respawned = false
- mCombo = {{"Ice","Light blue"},{"Marble","Grey"},{"Brick",Color3.new(97/255,0,0)}}
- maxhealthdefault = 5000
- maxhealth = 5000 -- default
- lastRespawnTime = tick()
- minRespawnTime = 20
- firstTime = true
- headm,headt = "http://www.roblox.com/asset/?id=15881174","http://www.roblox.com/asset/?id=15881163"
- name = "Cuddles"
- scale = 8
- ---------------------------------------------
- cf = CFrame.new
- ca = CFrame.fromEulerAnglesXYZ
- ms = math.sin
- mr = math.rad
- pi = math.pi
- ma = math.abs
- mcs = math.cos
- v3 = Vector3.new
- c3 = Color3.new
- bc = BrickColor.new
- function rand(a)
- return (math.random()-.5)*2*a
- end
- function Smoke(origin,dmg,color)
- local partz = Instance.new("Part",workspace)
- partz.Size = Vector3.new(0,0,0)
- partz.FormFactor = "Custom"
- partz.BrickColor = bc(color or "Black")
- partz.CanCollide = false
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.Transparency = 0.25
- partz.CFrame = origin * cf(math.random(-5,5),-1,math.random(-5,5))
- partz:BreakJoints()
- local meshz = Instance.new("SpecialMesh",partz)
- meshz.MeshType = "Sphere"
- meshz.Scale = v3(1.25,1.25,1.25)
- local bpz = Instance.new("BodyPosition",partz)
- bpz.D = 100
- bpz.P = 100
- bpz.position = partz.Position + Vector3.new(0,7,0)
- coroutine.resume(coroutine.create(function(partzz,meshzz)
- for i=25,100 do
- partzz.Transparency = i*0.01
- meshzz.Scale = meshzz.Scale + Vector3.new(0.15,0.1,0.15)
- wait()
- end
- partz:Destroy()
- end),partz,meshz)
- end
- function brickMagic(origin,color,size)
- local partz = Instance.new("Part",workspace)
- partz.Size = v3(size,size,size)
- partz.FormFactor = "Custom"
- partz.BrickColor = bc(color)
- partz.CanCollide = false
- partz.Anchored = true
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.Transparency = 0.2
- partz.CFrame = (origin * cf(0,-1,0)) * ca(math.random(0,5),math.random(0,5),math.random(0,5))
- partz:BreakJoints()
- local meshz = Instance.new("BlockMesh",partz)
- meshz.Scale = v3(1,1,1)
- coroutine.resume(coroutine.create(function(partzz,m)
- for i=2,10 do
- partzz.CFrame = partzz.CFrame * ca(math.random(0,5),math.random(0,5),math.random(0,5))
- partzz.Transparency = i*0.1
- m.Scale = m.Scale-Vector3.new(.125,.125,.125)
- wait()
- end
- partzz:Destroy()
- end),partz,meshz)
- end
- function spikeMagic(origin,size,color)
- local partz = Instance.new("Part",workspace)
- partz.FormFactor = "Custom"
- partz.Size = v3(1,1,1)
- partz.BrickColor = bc(color)
- partz.CanCollide = false
- partz.Anchored = true
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.Transparency = 0.2
- partz.CFrame = (origin * cf(0,-1,0))
- partz:BreakJoints()
- local meshz = Instance.new("FileMesh",partz)
- meshz.MeshId = asset..meshes["spike"]
- meshz.Scale = Vector3.new(size/2,size*2,size/2)
- coroutine.resume(coroutine.create(function(partzz,m)
- wait(math.random(4,5))
- for i=0.2,1,.025 do
- partzz.Transparency = i
- wait()
- end
- partzz:Destroy()
- end),partz,meshz)
- end
- function ringExplode(origin,color,size)
- local partz = Instance.new("Part",workspace)
- partz.FormFactor = "Custom"
- partz.Size = v3(size,size,1)
- partz.BrickColor = bc(color)
- partz.CanCollide = false
- partz.Anchored = true
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.Transparency = 0.2
- partz.CFrame = (origin * cf(0,-1,0))
- partz:BreakJoints()
- local meshz = Instance.new("FileMesh",partz)
- meshz.MeshId = asset..meshes["ring"]
- coroutine.resume(coroutine.create(function(partzz,m)
- for i=0.2,1,.025 do
- partzz.Transparency = i
- m.Scale = m.Scale + v3(.5,.5,0)
- wait()
- end
- partzz:Destroy()
- end),partz,meshz)
- end
- function placeRock(origin,size)
- local partz = Instance.new("Part",workspace)
- partz.Size = v3(size,size,size)
- partz.FormFactor = "Custom"
- partz.BrickColor = bc("Grey")
- partz.Material = "Marble"
- partz.CanCollide = true
- partz.Anchored = true
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.CFrame = (origin * cf(0,-1,0)) * ca(math.random(0,5),math.random(0,5),math.random(0,5))
- partz:BreakJoints()
- local meshz = Instance.new("BlockMesh",partz)
- meshz.Scale = v3(1,1,1)
- coroutine.resume(coroutine.create(function(partzz,m)
- wait(math.random(4,5))
- for i=0,1,.025 do
- partzz.Transparency = i
- wait()
- end
- partzz:Destroy()
- end),partz,meshz)
- end
- function placeFirePart(origin,size)
- local partz = Instance.new("Part",workspace)
- partz.FormFactor = "Custom"
- partz.Transparency = 1
- partz.CanCollide = false
- partz.Anchored = true
- partz.TopSurface,partz.BottomSurface = 0,0
- partz.CFrame = (origin * cf(0,-1,0)) * ca(math.random(0,5),math.random(0,5),math.random(0,5))
- partz:BreakJoints()
- local fire = Instance.new("Fire",partz)
- fire.Size = size
- local meshz = Instance.new("BlockMesh",partz)
- meshz.Scale = v3(1,1,1)
- coroutine.resume(coroutine.create(function(fi,partzz)
- wait(math.random(4,5))
- for i=1,fi.Size do
- fi.Size = fi.Size-1
- wait()
- end
- partzz:Destroy()
- end),fire,partz)
- end
- function quickSound(id,v)
- local s = Instance.new("Sound",workspace)
- s.SoundId = id
- s.PlayOnRemove = true
- s.Volume = v or 1
- delay(0.025,function()s:remove()end)
- end
- ---------------------------------------------
- local respawn
- function loadNew(npoint,scl)
- if ((tick()-lastRespawnTime) < minRespawnTime)and not firstTime and not Dead then return end
- lastRespawnTime = tick()
- firstTime = false
- pcall(function()model:Destroy()end)
- local ncombo = mCombo[math.random(1,#mCombo)]
- scale = scl or scale
- material = ncombo[1]
- color = ncombo[2]
- Mode = ""
- Attacking = false
- CurAttack = ""
- maxhealth = (scl and scl*100)or maxhealthdefault
- start = npoint or root.CFrame * CFrame.new(scale*2,scale*5,0)
- parts = {}
- model = Instance.new("Model",workspace)
- model.Name = name
- rootpart = Part("HumanoidRootPart",model,Vector3.new(2*scale,2*scale,1*scale),start,color,1,false,true,material)
- torso = Part("Torso",model,Vector3.new(2*scale,2*scale,1*scale),start,color,1,false,true,material)
- rootj = Weld(rootpart,torso)
- head = Part("Head",model,Vector3.new(1*scale,1*scale,1*scale),start,color,.9,false,true,material)
- headw = Weld(torso,head,CFrame.new(0,1*scale,0),CFrame.new(0,-.5*scale,0))
- larm = Part("Left Arm",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(larm,"Brick")
- larmw = Weld(torso,larm,CFrame.new(-1.5*scale,0.5*scale,0),CFrame.new(0,.02*scale,0))--CFrame.new(0.5*scale,0.5*scale,0))
- rarm = Part("Right Arm",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(rarm,"Brick")
- rarmw = Weld(torso,rarm,CFrame.new(1.5*scale,.5*scale,0),CFrame.new(0,0.02*scale,0))--CFrame.new(-0.5*scale,0.5*scale,0))
- lleg = Part("Left Leg",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(lleg,"Brick")
- llegw = Weld(torso,lleg,CFrame.new(-.5*scale,-1*scale,0),CFrame.new(0,.53*scale,0))--CFrame.new(-.5*scale,1*scale,0))
- rleg = Part("Right Leg",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(rleg,"Brick")
- rlegw = Weld(torso,rleg,CFrame.new(.5*scale,-1*scale,0),CFrame.new(0,.53*scale,0))--CFrame.new(.5*scale,1*scale,0))
- ------- extra joints (ex: front left arm)
- larml = Part("Left Arm",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(larml,"Brick")
- larmlw = Weld(larm,larml,CFrame.new(0,-0.5*scale,0.5*scale),CFrame.new(0,.5*scale,0.5*scale))
- rarml = Part("Right Arm",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(rarml,"Brick")
- rarmlw = Weld(rarm,rarml,CFrame.new(0,-0.5*scale,0.5*scale),CFrame.new(0,0.5*scale,0.5*scale))
- llegl = Part("Left Leg",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(llegl,"Brick")
- lleglw = Weld(lleg,llegl,CFrame.new(0,-0.5*scale,-0.5*scale),CFrame.new(0,0.5*scale,-0.5*scale))
- rlegl = Part("Right Leg",model,Vector3.new(1*scale,(2*scale)/2,1*scale),start,color,1,false,true,material)
- Mesh(rlegl,"Brick")
- rleglw = Weld(rleg,rlegl,CFrame.new(0,-0.5*scale,-0.5*scale),CFrame.new(0,0.5*scale,-0.5*scale))
- -------
- stand = Part("Stand",torso,Vector3.new(2*scale,2,1*scale),start,color,1,false,true,material)
- standw = Weld(rootpart,stand,CFrame.new(0,-(torso.Size.y+rleg.Size.y),0))
- --------- part making
- -- head
- for x=1,5 do
- for y=1,5 do
- for z=1,5 do
- local isfacecol = (x==2 and y==4 and z==5 and true)or(x==3 and y==4 and z==5 and true)or
- (x==4 and y==4 and z==5 and true)or
- (x==2 and y==2 and z==5 and true)or
- (x==4 and y==2 and z==5 and true)or false
- local p = Part("T",model,Vector3.new(scale/5,scale/5,scale/5),torso.CFrame,(isfacecol and "Really black")or color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.6,scale*.6,scale*.6)
- local w = Weld(head,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- end
- end
- end
- -- torso
- local tsx,tsy,tsz = torso.Size.X,torso.Size.Y,torso.Size.Z
- for x=1,3 do
- for y=1,5 do
- for z=1,2 do
- local p = Part("T",model,Vector3.new(scale/1.5,scale/2.5,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*1.325,scale*1.2,scale*.75)
- local w = Weld(torso,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- end
- end
- end
- -- la & ra & ll & rl
- for x=1,2 do
- for y=1,2 do
- for z=1,2 do
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(rarm,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(larm,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(rleg,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(lleg,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- ------------------------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(rarml,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(larml,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(rlegl,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- --------
- local p = Part("T",model,Vector3.new(scale/2,scale/2,scale/2),torso.CFrame,color,0,false,false,material)
- local cf = CFrame.new(x*p.Size.x,y*p.Size.y,z*p.Size.z):inverse()
- cf = cf * CFrame.new(scale*.75,scale*.75,scale*.75)
- local w = Weld(llegl,p,cf*CFrame.Angles(rand(.2),rand(.2),0))
- table.insert(parts,p)
- end
- end
- end
- --------- extras
- gunp1 = Part("GunPart1",model,Vector3.new(scale/2,scale/2,scale/2),rarm.CFrame,"Black",0,false,false,"SmoothPlastic")
- gunp1m = Instance.new("CylinderMesh",gunp1)
- gunp1w = Weld(rarml,gunp1,CFrame.new(0,-((rarml.Size.y/2)-(gunp1.Size.y/2)-1),0))
- gunp2 = Part("GunPart1",model,Vector3.new(scale/2,scale/2,scale/2)*1.1,rarm.CFrame,color,0,false,false,"SmoothPlastic")
- gunp1m = Instance.new("CylinderMesh",gunp2)
- gunp2w = Weld(gunp1,gunp2,CFrame.new(0,scale*.05,0))
- gunlight = Instance.new("PointLight",gunp1)
- gunlight.Enabled = false
- gunlight.Color = BrickColor.new("Bright yellow").Color
- gunlight.Range = 2*scale
- ogp1 = gunp1w.C0
- ---------
- game:service("ContentProvider"):Preload(asset..sounds["gun"])
- ---------
- humanoid = Instance.new("Humanoid",model)
- humanoid.Name = "Golem"
- humanoid.MaxHealth = maxhealth
- humanoid.Health = humanoid.MaxHealth
- local numb = humanoid.MaxHealth
- delay(.1,function() -- debug
- for i=1,20 do
- wait()
- humanoid.Health = numb
- end
- wait(1)print(humanoid.Health)
- end)
- oll,orl,ola,ora,oh = llegw.C0,rlegw.C0,larmw.C0,rarmw.C0,headw.C0
- olll,orll,olal,oral = lleglw.C0,rleglw.C0,larmlw.C0,rarmlw.C0
- orac1 = rarmw.C1
- orj = rootj.C0
- table.insert(parts,larm)table.insert(parts,rarm)table.insert(parts,lleg)table.insert(parts,rleg)table.insert(parts,head);
- table.insert(parts,torso)table.insert(parts,rootpart)
- table.insert(parts,larml)table.insert(parts,rarml)table.insert(parts,llegl)table.insert(parts,rlegl)
- ---------
- humanoid.Died:connect(respawn)
- Dead = false
- Respawned = false
- end
- function respawn()
- Dead = true
- for i,v in pairs(parts)do v.CanCollide = true v:BreakJoints() end
- coroutine.wrap(function()
- wait(5)
- local point = torso.CFrame
- point = CFrame.new(point.x,point.y+30,point.z)
- local nt = {}
- for i,v in pairs(parts)do table.insert(nt,{p=v,pos=point*CFrame.new(0,rand(10),0)}) end
- for i=1,25 do
- wait()
- for _,v in pairs(nt)do
- pcall(function()
- v.p.Anchored = true
- v.p.CFrame = clerp(v.p.CFrame,v.pos,i/25)
- end)
- end
- end
- for i,v in pairs(parts)do pcall(function()v.Parent = nil end)end
- loadNew(point)
- end)()
- end
- function Glory() ------------------------- todo
- if Dead or Respawning then return end
- Attacking = true
- CurAttack = "GloryS1"
- local lastt = tick()
- local chargetime = 300
- local num = 0
- local connect
- connect = step:connect(function()
- num = num + 1
- if (tick()-lastt) > .1 then
- lastt = tick()
- brickMagic(head.CFrame*CFrame.new(0,(2*scale)+(scale/2),0),"Really black",scale+2)
- end
- if num > chargetime or Respawned or Dead then
- Attacking = false
- CurAttack = ""
- connect:disconnect()
- end
- end)
- end
- function Shoot()
- if Dead or Respawning then return end
- Delay(0,function()gunlight.Enabled = true;wait(.1)gunlight.Enabled = false end)
- quickSound(asset..sounds["gun"],.2)
- local start = gunp1.CFrame*CFrame.Angles(-math.pi/2,0,0)
- ringExplode(CFrame.new(start.p,start.p-(start.lookVector*-4)),"Bright yellow",scale)
- local vel = start.lookVector
- local p = Part("Bullet",workspace,Vector3.new((scale>4 and 1)or .5,(scale>4 and 1)or .5,scale),start,color,0.4,true,false,"SmoothPlastic")
- local m = Mesh(p,"Sphere")
- local num = 0
- local ign = model:children()
- local connect
- connect = step:connect(function()
- num = num + 1
- local pp = p.Position
- local h,po
- repeat
- local r = Ray.new(pp,vel.unit*math.min(999.5,vel.magnitude/30+20))
- h,po = workspace:FindPartOnRayWithIgnoreList(r,ign)
- if h then
- if h.CanCollide then
- break
- else
- table.insert(ign,h)
- h = nil
- end
- else
- break
- end
- until false
- p.CFrame = CFrame.new(po,po+vel)
- if h or num > 300 or Respawned or Dead then
- local cf = p.CFrame
- coroutine.wrap(function(cfz)
- for i=1,math.random(1,3)do
- Smoke(cfz,1,color)
- end
- if h~=nil then
- local obj = h.CFrame:pointToObjectSpace(po)
- local siz = h.Size/2
- local svec = obj/siz
- svec = Vector3.new(math.floor(math.abs(svec.X)+.01)*svec.X/math.abs(svec.X),
- math.floor(math.abs(svec.Y))*svec.Y/math.abs(svec.Y) ,
- math.floor(math.abs(svec.Z))*svec.Z/math.abs(svec.Z))
- if svec.magnitude ~= 1 then return end
- local dir = h.CFrame:vectorToWorldSpace(svec)
- for i=1,math.random(1,3)do
- if material=="Ice" then
- spikeMagic(CFrame.new(po,po-dir)*CFrame.new(math.random(-3,3),0,math.random(-3,3))*CFrame.Angles(math.pi/2,0,0),math.random(scale-2,scale),color)
- elseif material=="Marble" then
- placeRock(CFrame.new(po,po-dir)*CFrame.new(math.random(-3,3),0,math.random(-3,3)),math.random(scale-2,scale))
- elseif material=="Brick" then
- placeFirePart(CFrame.new(po,po-dir)*CFrame.new(math.random(-3,3),0,math.random(-3,3)),math.random(scale,scale+4))
- end
- end
- end
- end)(cf)
- if h then
- if h.Parent:FindFirstChild("Humanoid")and h.Parent~=model then
- h.Parent:FindFirstChild("Humanoid"):TakeDamage(5*(scale/2))
- elseif h.Parent:FindFirstChild("Golem")and h.Parent~=model then
- h.Parent:FindFirstChild("Golem"):TakeDamage(50*scale)
- end
- end
- p:Destroy()
- connect:disconnect()
- end
- end)
- end
- loadNew()
- bg = Instance.new("BodyGyro")
- bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
- bg.P = 20e+003
- ---------------------------------------------
- mouse.KeyDown:connect(function(key)
- key:lower()
- if Dead then return end
- if key=="q" then
- root.CFrame = torso.CFrame*CFrame.new(0,scale*2.5,0)
- elseif key=="l" then
- if CurAttack=="LaserArm" then
- Attacking = false
- CurAttack = ""
- else
- if not Attacking then
- Attacking = true
- CurAttack = "LaserArm"
- end
- end
- elseif key=="t" then
- if not Attacking then
- Glory()
- end
- elseif key=="r" then
- Respawned = true
- loadNew()
- elseif key=="x" then
- --Attacking = true
- --CurAttack = "Grab"
- end
- end)
- mouse.Button1Down:connect(function()
- local targ = mouse.Target
- if targ and not Attacking and not Dead then
- humanoid:MoveTo(mouse.Hit.p,targ)
- elseif Attacking and CurAttack=="LaserArm" then
- Down = true
- while Down and Attacking and CurAttack=="LaserArm" do
- --if not Down or not Attacking or CurAttack~="LaserArm" then break end -- dis debug tho
- wait(.25)
- Shoot()
- end
- end
- end)
- mouse.Button2Down:connect(function()
- if not Attacking and not Dead then
- -- humanoid:MoveTo(torso.Position,torso)
- end
- end)
- mouse.Button1Up:connect(function()
- Down = false
- end)
- player.Chatted:connect(function(msg)
- msg:lower()
- if msg:sub(1,6)=="/scale" then
- if tonumber(msg:sub(8)) < 1 then return end
- local cf = torso.CFrame*CFrame.new(0,tonumber(msg:sub(8))*2,0)
- loadNew(cf,tonumber(msg:sub(8)) or 10)
- end
- end)
- --------------------------------------------- anims
- count = 0
- angle = 0
- counttime = 70
- countspeed = 1
- speed = .3
- step:connect(function()
- if not Dead then
- count = (count%counttime)+countspeed
- angle = math.pi*math.cos((math.pi*2)/counttime*count)
- humanoid.WalkSpeed = (scale > 5 and scale*2)or 10
- rarm.CanCollide,larm.CanCollide,lleg.CanCollide,rleg.CanCollide = true,true,true,true
- for i,v in pairs(parts)do v.CanCollide = true end
- model.Name = name
- torVel = Vector3.new(torso.Velocity.x,0,torso.Velocity.z)
- if not Attacking then
- if torVel.magnitude > 2 then
- Mode = "Walking"
- elseif torVel.magnitude < 2 then
- Mode = "Idle"
- end
- else
- humanoid:MoveTo(torso.Position,torso)
- Mode = CurAttack
- end
- if Mode=="Idle" then
- bg.Parent = nil
- speed,countspeed,counttime = .3,.8,100
- gunp1w.C0 = clerp(gunp1w.C0,ogp1,speed)
- rlegw.C0 = clerp(rlegw.C0,orl*CFrame.Angles(angle*speed*.2,0,0),speed)
- rarmw.C0 = clerp(rarmw.C0,ora*CFrame.Angles(-angle*speed*.2+math.abs(angle*.1),0,0),speed)
- rarmw.C1 = clerp(rarmw.C1,orac1,speed)
- llegw.C0 = clerp(llegw.C0,oll*CFrame.Angles(-angle*speed*.2,0,0),speed)
- larmw.C0 = clerp(larmw.C0,ola*CFrame.Angles(angle*speed*.2+math.abs(angle*.1),0,0),speed)
- --------
- rleglw.C0 = clerp(rleglw.C0,orll*CFrame.Angles(angle*speed*.1,0,0),speed)
- rarmlw.C0 = clerp(rarmlw.C0,oral*CFrame.Angles(-angle*speed*.1,0,0),speed)
- lleglw.C0 = clerp(lleglw.C0,olll*CFrame.Angles(-angle*speed*.1,0,0),speed)
- larmlw.C0 = clerp(larmlw.C0,olal*CFrame.Angles(angle*speed*.1,0,0),speed)
- --------
- headw.C0 = clerp(headw.C0,oh*CFrame.Angles(0,0,0),speed)
- rootj.C0 = clerp(rootj.C0,orj*CFrame.Angles(0,0,0),speed)
- elseif Mode=="Walking" then
- bg.Parent = nil
- speed,countspeed,counttime = .5,1,30
- gunp1w.C0 = clerp(gunp1w.C0,ogp1,speed)
- rlegw.C0 = clerp(rlegw.C0,orl*CFrame.Angles(angle*speed*.3,0,0),speed)
- rarmw.C0 = clerp(rarmw.C0,ora*CFrame.Angles(-angle*speed*.3,0,0),speed)
- rarmw.C1 = clerp(rarmw.C1,orac1,speed)
- llegw.C0 = clerp(llegw.C0,oll*CFrame.Angles(-angle*speed*.3,0,0),speed)
- larmw.C0 = clerp(larmw.C0,ola*CFrame.Angles(angle*speed*.3,0,0),speed)
- --------
- rleglw.C0 = clerp(rleglw.C0,orll*CFrame.Angles(-math.abs(angle*speed*.1),0,0),speed)
- rarmlw.C0 = clerp(rarmlw.C0,oral*CFrame.Angles(math.abs(angle*speed*.1),0,0),speed)
- lleglw.C0 = clerp(lleglw.C0,olll*CFrame.Angles(-math.abs(angle*speed*.1),0,0),speed)
- larmlw.C0 = clerp(larmlw.C0,olal*CFrame.Angles(math.abs(angle*speed*.1),0,0),speed)
- --------
- headw.C0 = clerp(headw.C0,oh*CFrame.Angles(0,0,0),speed)
- rootj.C0 = clerp(rootj.C0,orj*CFrame.Angles(0,0,0),speed)
- elseif Mode=="LaserArm" then
- bg.Parent = nil
- speed,countspeed,counttime = .3,.8,100
- local mpos = torso.CFrame * CFrame.new(1.5*scale,0.5*scale,0) -- thx doogle <3
- local cf = CFrame.new(mpos.p,mouse.Hit.p) * CFrame.Angles(math.pi/2,0,0)
- local x,y,z = torso.CFrame:toObjectSpace(cf):toEulerAnglesXYZ()
- gunp1w.C0 = clerp(gunp1w.C0,CFrame.new(0,-((rarm.Size.y/2)+(gunp1.Size.y/2)),0),speed)
- rlegw.C0 = clerp(rlegw.C0,orl*CFrame.Angles(angle*speed*.2,0,0),speed)
- rarmw.C0 = clerp(rarmw.C0,ora*CFrame.Angles(x,y,z),speed)
- llegw.C0 = clerp(llegw.C0,oll*CFrame.Angles(-angle*speed*.2,0,0),speed)
- larmw.C0 = clerp(larmw.C0,ola*CFrame.Angles(angle*speed*.2+math.abs(angle*.1),0,0),speed)
- --------
- rleglw.C0 = clerp(rleglw.C0,orll*CFrame.Angles(angle*speed*.1,0,0),speed)
- rarmlw.C0 = clerp(rarmlw.C0,oral,speed)
- lleglw.C0 = clerp(lleglw.C0,olll*CFrame.Angles(-angle*speed*.1,0,0),speed)
- larmlw.C0 = clerp(larmlw.C0,olal*CFrame.Angles(angle*speed*.05+math.abs(angle*.1),0,0),speed)
- --------
- headw.C0 = clerp(headw.C0,oh*CFrame.Angles(0,0,0),speed)
- rootj.C0 = clerp(rootj.C0,orj*CFrame.Angles(0,0,0),speed)
- elseif Mode=="GloryS1" then
- bg.Parent = nil
- speed,countspeed,counttime = .3,.8,100
- gunp1w.C0 = clerp(gunp1w.C0,ogp1,speed)
- rlegw.C0 = clerp(rlegw.C0,orl*CFrame.Angles(angle*speed*.2,0,0),speed)
- rarmw.C0 = clerp(rarmw.C0,ora*CFrame.Angles(angle*speed*.2-math.pi,0,-.25),speed)
- rarmw.C1 = clerp(rarmw.C1,orac1,speed)
- llegw.C0 = clerp(llegw.C0,oll*CFrame.Angles(-angle*speed*.2,0,0),speed)
- larmw.C0 = clerp(larmw.C0,ola*CFrame.Angles(angle*speed*.1-math.pi,0,.25),speed)
- --------
- rleglw.C0 = clerp(rleglw.C0,orll*CFrame.Angles(angle*speed*.1,0,0),speed)
- rarmlw.C0 = clerp(rarmlw.C0,oral*CFrame.Angles(-angle*speed*.05,0,0),speed)
- lleglw.C0 = clerp(lleglw.C0,olll*CFrame.Angles(-angle*speed*.1,0,0),speed)
- larmlw.C0 = clerp(larmlw.C0,olal*CFrame.Angles(angle*speed*.05,0,0),speed)
- --------
- headw.C0 = clerp(headw.C0,oh*CFrame.Angles(0,0,0),speed)
- rootj.C0 = clerp(rootj.C0,orj*CFrame.Angles(0,0,0),speed)
- elseif Mode=="Grab" then -------------------------------------- todo
- bg.Parent = nil
- speed,countspeed,counttime = .3,.8,100
- gunp1w.C0 = clerp(gunp1w.C0,ogp1,speed)
- rlegw.C0 = clerp(rlegw.C0,orl*CFrame.Angles(0,0,0),speed)
- rarmw.C0 = clerp(rarmw.C0,ora*CFrame.Angles(0,0,0),speed)
- rarmw.C1 = clerp(rarmw.C1,orac1,speed)
- llegw.C0 = clerp(llegw.C0,oll*CFrame.Angles(0,0,0),speed)
- larmw.C0 = clerp(larmw.C0,ola*CFrame.Angles(0,0,0),speed)
- --------
- rleglw.C0 = clerp(rleglw.C0,orll*CFrame.Angles(0,0,0),speed)
- rarmlw.C0 = clerp(rarmlw.C0,oral*CFrame.Angles(0,0,0),speed)
- lleglw.C0 = clerp(lleglw.C0,olll*CFrame.Angles(0,0,0),speed)
- larmlw.C0 = clerp(larmlw.C0,olal*CFrame.Angles(0,0,0),speed)
- --------
- headw.C0 = clerp(headw.C0,oh*CFrame.Angles(0,0,0),speed)
- rootj.C0 = clerp(rootj.C0,orj*CFrame.Angles(0,0,0),speed)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement