← KEMBALI KE SCRIPT LIBRARY

Laba laba Cannon

UmumVersi 1.0Update 25/11/2026

Laba Laba Musuh yang mempunyai senjata Cannon di atas tubuh nya

Cara penggunaan
Full Tutorial di YouTube iBalDBK
Lokasi pemasangan
Folder bernama ServerScriptService
ScriptServerScriptService
local TS=game:GetService("TweenService")
local RS=game:GetService("RunService")
local PL=game:GetService("Players")
local place=workspace:WaitForChild("LabaLabaPlace")
local HP,SPEED,STOP,CHASE,SR,MR=5000,14,12,200,110,16
local BD,MD,BS,RESP,H=25,35,65,20,8
local PU=Color3.fromRGB(105,25,200)
local WH=Color3.fromRGB(245,245,250)
local GO=Color3.fromRGB(255,190,20)
local NE=Color3.fromRGB(200,70,255)
local V,CF=Vector3.new,CFrame.new
local sin,cos,sqrt,max,min,rad=math.sin,math.cos,math.sqrt,math.max,math.min,math.rad
local NEON,BALL=Enum.Material.Neon,Enum.PartType.Ball
local FX_INFO=TweenInfo.new(0.4)

-- efek ringan (tanpa PointLight)
local function ball(pos,sz,col)
	local p=Instance.new("Part")
	p.Shape=BALL
	p.Material=NEON
	p.Color=col
	p.Anchored=true
	p.CanCollide=false
	p.CanTouch=false
	p.CanQuery=false
	p.CastShadow=false
	p.Size=V(sz,sz,sz)
	p.Position=pos
	p.Parent=workspace
	return p
end

local function fx(pos,sz,col)
	local p=ball(pos,2,col)
	local t=TS:Create(p,FX_INFO,{Size=V(sz,sz,sz),Transparency=1})
	t.Completed:Connect(function() p:Destroy() end)
	t:Play()
end

local function hurt(pos,r,d)
	local r2=r*r
	for _,pl in ipairs(PL:GetPlayers()) do
		local c=pl.Character
		local h=c and c:FindFirstChildOfClass("Humanoid")
		local x=c and c:FindFirstChild("HumanoidRootPart")
		if h and x and h.Health>0 then
			local o=x.Position-pos
			if o:Dot(o)<=r2 then h:TakeDamage(d) end
		end
	end
end

local function spawnBoss()
	local gy=place.Position.Y+place.Size.Y/2
	local cx,cz=place.Position.X,place.Position.Z
	local hx=max(place.Size.X/2-16,2)
	local hz=max(place.Size.Z/2-16,2)
	local base=CF(cx,gy+H,cz)
	local model=Instance.new("Model")
	model.Name="BossLabaLaba"
	local root
	local function mk(n,sz,rel,col,mat,shape,wp)
		local p=Instance.new("Part")
		p.Name=n
		if shape then p.Shape=shape end
		p.Size=sz
		p.Color=col
		p.Material=mat or Enum.Material.Plastic
		p.TopSurface=Enum.SurfaceType.Studs
		p.CanCollide=false
		p.CanTouch=false
		p.CanQuery=false
		p.CastShadow=false
		p.Massless=true
		p.Anchored=(root==nil)
		p.CFrame=base*rel
		p.Parent=model
		if not root then
			root=p
		elseif wp~=false then
			local w=Instance.new("WeldConstraint")
			w.Part0=wp or root
			w.Part1=p
			w.Parent=p
		end
		return p
	end

	-- BADAN
	mk("Root",V(10,4,11),CF(),PU)
	mk("A1",V(9,2,10),CF(0,3,0),WH)
	mk("A2",V(6,2,7),CF(0,5,0),PU)
	mk("A3",V(3,1.2,4),CF(0,6.4,-0.5),GO)
	-- perut membulat
	mk("Ab",V(11,8,11),CF(0,2.5,8.5),WH,nil,BALL)
	mk("AbS",V(3,8.4,11.4),CF(0,2.5,8.5),PU,nil,BALL)
	mk("AbG",V(1,8.4,11.4),CF(-4,2.5,8.5),GO,nil,BALL)
	mk("AbG",V(1,8.4,11.4),CF(4,2.5,8.5),GO,nil,BALL)

	-- ===== KEPALA OVAL PREMIUM =====
	local HC=V(0,0.5,-7.5)
	local RX,RY,RZ=4.2,3.2,3.6 -- radius elips kepala
	-- titik di permukaan lengkung kepala (x,y relatif pusat kepala)
	local function surf(x,y,off)
		local q=1-(x/RX)^2-(y/RY)^2
		if q<0.03 then q=0.03 end
		local lz=-RZ*sqrt(q)
		local n=V(x/(RX*RX),y/(RY*RY),lz/(RZ*RZ)).Unit
		local p=HC+V(x,y,lz)+n*(off or 0)
		return CFrame.lookAt(p,p+n)
	end

	mk("Head",V(8.4,6.4,7.2),CF(HC),WH,nil,BALL)
	mk("HeadS",V(1.4,6.7,7.5),CF(HC),PU,nil,BALL) -- garis ungu tengah
	mk("StudTop",V(2,0.6,3),CF(HC+V(0,3.3,0.2)),PU) -- stud atas kepala
	-- armor pipi, aksen ungu + emas
	for _,s in ipairs{-1,1} do
		mk("Cheek",V(1.8,2.8,2.6),surf(s*3.7,-0.6,-0.4),PU,nil,BALL)
		mk("CheekG",V(1.4,1.1,2.2),surf(s*3.5,-2,-0.3),GO,nil,BALL)
		mk("Plate",V(2.8,1.6,2.8),surf(s*2.6,2.3,-0.3),WH,nil,BALL)
		mk("StudP",V(1.6,0.5,1.6),surf(s*2.6,2.7,0.1),PU)
	end

	-- alis emas melengkung (3 segmen per sisi mengikuti lengkung wajah)
	local bx={0.9,1.9,2.9}
	local by={1.7,1.95,1.6}
	local br={0.45,0.12,-0.3}
	for _,s in ipairs{-1,1} do
		for i=1,3 do
			mk("Brow",V(1.4,0.45,0.5),surf(s*bx[i],by[i],0.1)*CFrame.Angles(0,0,s*br[i]),GO)
		end
		-- V emas di dahi
		mk("Chev",V(1.8,0.55,0.5),surf(s*0.9,2.75,0.1)*CFrame.Angles(0,0,s*0.5),GO)
	end

	-- 6 mata neon ungu, ukuran bervariasi, simetris
	local eyes={{1.7,0.2,1.5},{3.0,-0.5,1.0},{1.0,-1.4,0.75}}
	local eyeP
	for _,s in ipairs{-1,1} do
		for i,e in ipairs(eyes) do
			local sz=e[3]
			if i==1 then
				mk("EyeRing",V(sz+0.8,sz+0.8,sz+0.8),surf(s*e[1],e[2],-0.1),GO,nil,BALL)
			end
			eyeP=mk("Eye",V(sz,sz,sz),surf(s*e[1],e[2],sz*0.25),NE,NEON,BALL)
		end
	end

	-- rahang kecil + 2 taring emas
	for _,s in ipairs{-1,1} do
		mk("Man",V(1.5,1.6,1.5),CF(s*1.2,-2.4,-9.4),WH,nil,BALL)
		mk("Fang",V(0.7,2.4,0.7),CF(s*1.2,-4.2,-9.7)*CFrame.Angles(rad(-12),0,-s*0.15),GO)
	end

	-- 2 CANNON SILINDER FUTURISTIK (menyatu di sisi badan, tanpa dudukan)
	local cores={}
	local CYL=Enum.PartType.Cylinder
	local DK=Color3.fromRGB(40,8,80)
	for _,s in ipairs{-1,1} do
		local P=V(s*7,5.4,0)
		local d=V(s*0.22,0,-1).Unit -- menghadap depan + sedikit ke samping
		local C=CFrame.lookAt(P,P+d)
		-- silinder: sumbu X diputar 90 derajat agar searah sumbu Z cannon
		local function cyl(n,len,dia,t,col)
			return mk(n,V(len,dia,dia),C*CF(0,0,-t)*CFrame.Angles(0,rad(90),0),col,nil,CYL)
		end
		-- cincin plat stud mengelilingi tabung
		local function studRing(t,R,cols,off)
			for k=0,5 do
				mk("Stud",V(1.5,0.45,1.5),C*CFrame.Angles(0,0,rad(k*60+off))*CF(0,R,-t),cols[k%2+1])
			end
		end

		-- penutup belakang
		mk("CapB",V(5.8,5.8,5.8),C*CF(0,0,0.4),PU,nil,BALL)
		cyl("RingR",0.6,6.2,0.3,GO)
		-- badan tabung armor putih
		cyl("Tube",7,5.4,3.5,WH)
		cyl("Band",1.2,5.9,1.6,PU)
		cyl("RingM",0.5,6.2,3.0,GO)
		cyl("Band",1.2,5.9,4.4,PU)
		studRing(2.3,2.85,{PU,GO},0)
		studRing(5.8,2.85,{GO,PU},30)
		-- moncong: flensa emas + cincin emas tebal
		cyl("Flange",0.6,7.4,6.6,GO)
		cyl("Muzzle",1.6,7,7.7,GO)
		cyl("MuzzleP",0.5,6.2,7.0,PU)
		-- bagian dalam ungu gelap
		cyl("Inner",1.7,4.8,7.75,DK)
		-- inti energi neon (dipakai untuk menembak)
		cores[#cores+1]=mk("Core",V(3.4,3.4,3.4),C*CF(0,0,-7.7),NE,NEON,BALL)
	end

	-- 8 KAKI
	local legs={}
	local angs={55,25,-10,-40}
	for _,s in ipairs{-1,1} do
		for i=1,4 do
			local a=rad(angs[i])
			local hip=V(s*5,-1,-4+(i-1)*2.7)
			local LF=CFrame.lookAt(hip,hip+V(s*cos(a),0,-sin(a)))
			local U=CF(0,1.5,-2.6)*CFrame.Angles(rad(30),0,0)
			local c1,c2=PU,WH
			if i%2==0 then c1,c2=WH,PU end
			local up=mk("Up",V(1.8,1.8,6.2),LF*U,c1,nil,nil,false)
			local m=Instance.new("Motor6D")
			m.Part0=root
			m.Part1=up
			m.C0=LF
			m.C1=U:Inverse()
			m.Parent=up
			local k=V(0,3,-5.2)
			local d=V(0,-10,-4).Unit
			mk("Knee",V(2.2,2.2,2.2),LF*CF(k),GO,nil,nil,up)
			local lc=k+d*5.25
			mk("Low",V(1.5,1.5,10.5),LF*CFrame.lookAt(lc,lc+d),c2,nil,nil,up)
			local tc=k+d*9
			mk("Claw",V(1.2,1.2,3.6),LF*CFrame.lookAt(tc,tc+d),GO,nil,nil,up)
			legs[#legs+1]={m=m,b=LF,s=s,g=(i+(s==1 and 0 or 1))%2,f=(i==1),cy=0,cp=0}
		end
	end

	-- HP
	local hum=Instance.new("Humanoid")
	hum.MaxHealth=HP
	hum.Health=HP
	hum.RequiresNeck=false
	hum.BreakJointsOnDeath=false
	hum.EvaluateStateMachine=false
	hum.DisplayDistanceType=Enum.HumanoidDisplayDistanceType.None
	hum.Parent=model
	model.PrimaryPart=root
	model.Parent=workspace

	local alive,moving,atk=true,false,false
	local atkStage=0
	local pos=V(cx,gy,cz)
	local dir=V(0,0,-1)
	local target,lastS,lastM,tt,acc=nil,0,0,0,0
	local gp,mv=0,0

	local TI_SHOT=TweenInfo.new(0.12,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,true)
	local function shoot(core,tr)
		local from=core.Position
		local d=(tr.Position-from).Magnitude
		local to=tr.Position+tr.AssemblyLinearVelocity*(d/BS)*0.5
		TS:Create(core,TI_SHOT,{Size=V(4.8,4.8,4.8)}):Play()
		local b=ball(from,3.5,NE)
		local tw=TS:Create(b,TweenInfo.new(max(d/BS,0.1),Enum.EasingStyle.Linear),{Position=to})
		tw.Completed:Connect(function()
			fx(to,18,NE)
			hurt(to,9,BD)
			b:Destroy()
		end)
		tw:Play()
	end

	local function fire(tr)
		lastS=tick()
		for i,c in ipairs(cores) do
			task.delay((i-1)*0.3,function()
				if alive and tr.Parent then shoot(c,tr) end
			end)
		end
	end

	local function melee()
		atk=true
		lastM=tick()
		atkStage=1
		task.wait(0.3)
		atkStage=2
		task.wait(0.1)
		if alive then
			local cf=root.CFrame
			local hp=cf.Position+cf.LookVector*11-V(0,H-1,0)
			fx(hp,16,GO)
			hurt(hp,12,MD)
		end
		task.wait(0.35)
		atkStage=0
		atk=false
	end

	local function nearest()
		local best,bd=nil,CHASE*CHASE
		for _,p in ipairs(PL:GetPlayers()) do
			local c=p.Character
			local h=c and c:FindFirstChildOfClass("Humanoid")
			local x=c and c:FindFirstChild("HumanoidRootPart")
			if h and x and h.Health>0 then
				local o=x.Position-pos
				local d=o:Dot(o)
				if d<bd then best,bd=x,d end
			end
		end
		return best
	end

	local conn
	conn=RS.Heartbeat:Connect(function(dt0)
		if not model.Parent then conn:Disconnect() return end
		acc+=dt0
		if acc<1/30 then return end
		local dt=acc
		acc=0
		if not alive then return end
		tt+=dt
		if tt>=0.25 then tt=0 target=nearest() end
		if target and target.Parent then
			local tp=target.Position
			local f=V(tp.X-pos.X,0,tp.Z-pos.Z)
			local d=f.Magnitude
			if d>0.5 then
				local nd=dir:Lerp(f.Unit,min(1,dt*5))
				if nd.Magnitude>0.05 then dir=nd.Unit end
			end
			moving=d>STOP
			if moving then
				local n=pos+dir*SPEED*dt
				pos=V(math.clamp(n.X,cx-hx,cx+hx),gy,math.clamp(n.Z,cz-hz,cz+hz))
			end
			local now=tick()
			if not atk and d<=MR and now-lastM>2.5 then
				task.spawn(melee)
			elseif d>MR and d<=SR and now-lastS>3 then
				fire(target)
			end
		else
			moving=false
		end

		-- animasi kaki langsung (tanpa membuat Tween tiap langkah)
		mv+=((moving and 1 or 0)-mv)*min(1,dt*6)
		gp+=dt*(2.5+9.5*mv)
		local al=min(1,dt*14)
		for _,l in ipairs(legs) do
			local ty,tp
			if l.f and atkStage>0 then
				if atkStage==1 then ty,tp=-0.3*l.s,0.75 else ty,tp=0.7*l.s,-0.1 end
			else
				local ph=gp+l.g*math.pi
				ty=sin(ph)*0.32*l.s*mv
				tp=-0.03+max(0,cos(ph))*(0.1+0.2*mv)
			end
			l.cy+=(ty-l.cy)*al
			l.cp+=(tp-l.cp)*al
			l.m.C0=l.b*CFrame.Angles(l.cp,l.cy,0)
		end

		-- gerak badan: cukup gerakkan root (semua part ikut via weld)
		local bob=(sin(os.clock()*2.85)+1)*0.35
		local p=pos+V(0,H+bob,0)
		root.CFrame=CFrame.lookAt(p,p+dir)
	end)

	hum.Died:Connect(function()
		alive=false
		conn:Disconnect()
		for i=1,4 do
			fx(root.Position+V(math.random(-6,6),math.random(0,6),math.random(-6,6)),14,(i%2==0) and GO or NE)
		end
		task.wait(0.6)
		model:Destroy()
	end)
	return hum
end

while true do
	local h=spawnBoss()
	h.Died:Wait()
	task.wait(RESP)
end