JIT
simplifying and optimizing your Roblox code
this code. local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local player = Players:FindFirstChild("AlphonsoGames") if not player then return end -- Configuration local BASE_SIZE = 150 local WINDUP_SIZE = BASE_SIZE * 25 local MIN_SIZE = 15 local FLOAT_HEIGHT = 2 local FLOAT_DURATION = 2 local WINDUP_DURATION = 9.25 local APPEAR_DELAY = 0.5 local SHRINK_DURATION = 3.25 local BASE_TEXTURE_SPEED = 0.325 local WINDUP_TEXTURE_SPEED = 50 -- Fast speed during windup local HEALTH_DRAIN_RATE = 50 -- Health points per second local DAMAGE_CHECK_INTERVAL = 0.1 -- Seconds between damage checks -- Track which players have already died to the circle local deadPlayers = {} -- Create the main part local part = Instance.new("Part") part.Name = "Main" part.BottomSurface = Enum.SurfaceType.Smooth part.CanCollide = false part.Transparency = 0.5 part.TopSurface = Enum.SurfaceType.Smooth part.Color = Color3.fromRGB(0, 255, 255) part.Massless = true part.Reflectance = 1 part.Material = Enum.Material.Neon part.Size = Vector3.new(2, 2, 2) part.CanTouch = false part.Anchored = true part.AudioCanCollide = false part.Position = player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player.Character.HumanoidRootPart.Position or Vector3.new(0, 0, 0) -- Create attachments for blue beams local attachment1 = Instance.new("Attachment") attachment1.Name = "Attachment1" attachment1.CFrame = CFrame.new(0, 0, -1 * BASE_SIZE) attachment1.Position = Vector3.new(0, 0, -1 * BASE_SIZE) attachment1.Parent = part local attachment2 = Instance.new("Attachment") attachment2.Name = "Attachment2" attachment2.CFrame = CFrame.new(0, 0 * BASE_SIZE, 1 * BASE_SIZE) attachment2.Position = Vector3.new(0, 0 * BASE_SIZE, 1 * BASE_SIZE) attachment2.Parent = part -- Create attachments for red beams local redAttachment1 = Instance.new("Attachment") redAttachment1.Name = "RedAttachment1" redAttachment1.CFrame = CFrame.new(0, 0, -1 * BASE_SIZE) redAttachment1.Position = Vector3.new(0, 0, -1 * BASE_SIZE) redAttachment1.Parent = part local redAttachment2 = Instance.new("Attachment") redAttachment2.Name = "RedAttachment2" redAttachment2.CFrame = CFrame.new(0, 0 * BASE_SIZE, 1 * BASE_SIZE) redAttachment2.Position = Vector3.new(0, 0 * BASE_SIZE, 1 * BASE_SIZE) redAttachment2.Parent = part -- Create blue beams (initially disabled) local beam1 = Instance.new("Beam") beam1.Name = "Circle1" beam1.CurveSize1 = -1.35 * BASE_SIZE beam1.CurveSize0 = 1.35 * BASE_SIZE beam1.LightInfluence = 1 beam1.Segments = 999 beam1.TextureSpeed = BASE_TEXTURE_SPEED beam1.Width1 = 9999999 beam1.Width0 = 9999999 beam1.Transparency = NumberSequence.new(0) beam1.TextureLength = 5 beam1.LightEmission = 0.75 beam1.Texture = "rbxassetid://124670965229302" beam1.Attachment0 = attachment1 beam1.Attachment1 = attachment2 beam1.Enabled = false beam1.Parent = part local beam2 = Instance.new("Beam") beam2.Name = "Circle2" beam2.CurveSize1 = 1.35 * BASE_SIZE beam2.CurveSize0 = -1.35 * BASE_SIZE beam2.LightInfluence = 1 beam2.Segments = 999 beam2.TextureSpeed = -BASE_TEXTURE_SPEED beam2.Width1 = 9999999 beam2.Width0 = 9999999 beam2.Transparency = NumberSequence.new(0) beam2.TextureLength = 5 beam2.LightEmission = 0.75 beam2.Texture = "rbxassetid://124670965229302" beam2.Attachment0 = attachment1 beam2.Attachment1 = attachment2 beam2.Enabled = false beam2.Parent = part -- Create red beams (initially disabled) local redBeam1 = Instance.new("Beam") redBeam1.Name = "RedCircle1" redBeam1.CurveSize1 = -1.35 * BASE_SIZE redBeam1.CurveSize0 = 1.35 * BASE_SIZE redBeam1.LightInfluence = 1 redBeam1.Segments = 999 redBeam1.TextureSpeed = BASE_TEXTURE_SPEED redBeam1.Width1 = 9999999 redBeam1.Width0 = 9999999 redBeam1.Transparency = NumberSequence.new(0) redBeam1.TextureLength = 5 redBeam1.LightEmission = 1.5 -- Increased brightness redBeam1.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0)) redBeam1.Texture = "rbxassetid://124670965229302" redBeam1.Attachment0 = redAttachment1 redBeam1.Attachment1 = redAttachment2 redBeam1.Enabled = false redBeam1.Parent = part local redBeam2 = Instance.new("Beam") redBeam2.Name = "RedCircle2" redBeam2.CurveSize1 = 1.35 * BASE_SIZE redBeam2.CurveSize0 = -1.35 * BASE_SIZE redBeam2.LightInfluence = 1 redBeam2.Segments = 999 redBeam2.TextureSpeed = -BASE_TEXTURE_SPEED redBeam2.Width1 = 9999999 redBeam2.Width0 = 9999999 redBeam2.Transparency = NumberSequence.new(0) redBeam2.TextureLength = 5 redBeam2.LightEmission = 1.5 -- Increased brightness redBeam2.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0)) redBeam2.Texture = "rbxassetid://124670965229302" redBeam2.Attachment0 = redAttachment1 redBeam2.Attachment1 = redAttachment2 redBeam2.Enabled = false redBeam2.Parent = part -- Create decals local decalFaces = {Enum.NormalId.Front, Enum.NormalId.Back, Enum.NormalId.Left, Enum.NormalId.Right, Enum.NormalId.Top, Enum.NormalId.Bottom} for i, face in ipairs(decalFaces) do local decal = Instance.new("Decal") decal.Name = "Decal"..i decal.Face = face decal.Transparency = 0.5 decal.Color3 = Color3.fromRGB(0, 213, 255) decal.Texture = "rbxassetid://283481847" decal.Parent = part end -- Create billboard indicator local billboard = Instance.new("BillboardGui") billboard.Name = "Indicator" billboard.AlwaysOnTop = true billboard.Size = UDim2.new(1.25, 0, 1.25, 0) billboard.StudsOffset = Vector3.new(0, 3.5, 0) billboard.Adornee = part local outline = Instance.new("Frame") outline.AnchorPoint = Vector2.new(0.5, 0.5) outline.Position = UDim2.new(0.5, 0, 0.5, 0) outline.Size = UDim2.new(1, 4, 1, 4) outline.BackgroundColor3 = Color3.fromRGB(0, 0, 0) outline.BorderSizePixel = 0 outline.Rotation = 45 outline.Parent = billboard local diamond = Instance.new("Frame") diamond.AnchorPoint = Vector2.new(0.5, 0.5) diamond.Position = UDim2.new(0.5, 0, 0.5, 0) diamond.Size = UDim2.new(1, 0, 1, 0) diamond.BackgroundColor3 = Color3.fromRGB(0, 170, 255) diamond.BackgroundTransparency = 0 diamond.BorderSizePixel = 0 diamond.Rotation = 45 diamond.Parent = billboard billboard.Parent = part -- Parent to workspace part.Parent = workspace -- Floating animation with easing local startPos = part.Position local tweenInfo = TweenInfo.new( FLOAT_DURATION, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true ) local floatTween = TweenService:Create( part, tweenInfo, {Position = startPos + Vector3.new(0, FLOAT_HEIGHT, 0)} ) floatTween:Play() -- Modified flicker function that only affects blue beams local function flickerBeams(intensity, speed) local flickerTime = 0 local flickerConnection flickerConnection = RunService.Heartbeat:Connect(function(deltaTime) flickerTime = flickerTime + deltaTime * speed local flickerValue = (math.sin(flickerTime * 10) + 1) / 2 * intensity beam1.LightEmission = 0.75 + flickerValue beam2.LightEmission = 0.75 + flickerValue end) return flickerConnection end -- Function for wind-up effect local function windUpEffect() -- Enable red beams (no flickering) redBeam1.Enabled = true redBeam2.Enabled = true -- Change indicator to red and make it bigger local indicatorTween = TweenService:Create( diamond, TweenInfo.new(0.5, Enum.EasingStyle.Quad), { BackgroundColor3 = Color3.fromRGB(255, 0, 0), Size = UDim2.new(6, 0, 6, 0) } ) indicatorTween:Play() -- Start with beams at windup size beam1.CurveSize1 = -1.35 * WINDUP_SIZE beam1.CurveSize0 = 1.35 * WINDUP_SIZE beam2.CurveSize1 = 1.35 * WINDUP_SIZE beam2.CurveSize0 = -1.35 * WINDUP_SIZE attachment1.Position = Vector3.new(0, 0, -1 * WINDUP_SIZE) attachment2.Position = Vector3.new(0, 0, 1 * WINDUP_SIZE) -- Fast texture speed beam1.TextureSpeed = WINDUP_TEXTURE_SPEED beam2.TextureSpeed = -WINDUP_TEXTURE_SPEED -- Intense flickering (only for blue beams) local flickerConnection = flickerBeams(0.5, 10) -- Create a single tween info for all properties local windupTweenInfo = TweenInfo.new( WINDUP_DURATION, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut ) -- Create property tables for simultaneous tweens local beam1Properties = { CurveSize1 = -1.35 * BASE_SIZE, CurveSize0 = 1.35 * BASE_SIZE, TextureSpeed = BASE_TEXTURE_SPEED } local beam2Properties = { CurveSize1 = 1.35 * BASE_SIZE, CurveSize0 = -1.35 * BASE_SIZE, TextureSpeed = -BASE_TEXTURE_SPEED } local attachment1Properties = { Position = Vector3.new(0, 0, -1 * BASE_SIZE) } local attachment2Properties = { Position = Vector3.new(0, 0, 1 * BASE_SIZE) } -- Create and play all tweens simultaneously local beam1Tween = TweenService:Create(beam1, windupTweenInfo, beam1Properties) local beam2Tween = TweenService:Create(beam2, windupTweenInfo, beam2Properties) local attachment1Tween = TweenService:Create(attachment1, windupTweenInfo, attachment1Properties) local attachment2Tween = TweenService:Create(attachment2, windupTweenInfo, attachment2Properties) beam1Tween:Play() beam2Tween:Play() attachment1Tween:Play() attachment2Tween:Play() -- Gradually reduce flickering (only for blue beams) task.delay(WINDUP_DURATION * 0.75, function() flickerConnection:Disconnect() flickerConnection = flickerBeams(0.2, 5) end) task.delay(WINDUP_DURATION, function() flickerConnection:Disconnect() beam1.LightEmission = 0.75 beam2.LightEmission = 0.75 -- Disable red beams and reset indicator redBeam1.Enabled = false redBeam2.Enabled = false local resetIndicatorTween = TweenService:Create( diamond, TweenInfo.new(0.5, Enum.EasingStyle.Quad), { BackgroundColor3 = Color3.fromRGB(0, 170, 255), Size = UDim2.new(1, 0, 1, 0) } ) resetIndicatorTween:Play() end) end -- Function to shrink the effect with easing local function shrinkEffect() local tweenInfo = TweenInfo.new( SHRINK_DURATION, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ) local currentSize = BASE_SIZE while currentSize > MIN_SIZE do local targetSize = math.max(currentSize - 1, MIN_SIZE) -- Create tweens for smooth transitions local beam1Tween1 = TweenService:Create( beam1, tweenInfo, {CurveSize1 = -1.35 * targetSize} ) local beam1Tween2 = TweenService:Create( beam1, tweenInfo, {CurveSize0 = 1.35 * targetSize} ) local beam2Tween1 = TweenService:Create( beam2, tweenInfo, {CurveSize1 = 1.35 * targetSize} ) local beam2Tween2 = TweenService:Create( beam2, tweenInfo, {CurveSize0 = -1.35 * targetSize} ) local attachment1Tween = TweenService:Create( attachment1, tweenInfo, {Position = Vector3.new(0, 0, -1 * targetSize)} ) local attachment2Tween = TweenService:Create( attachment2, tweenInfo, {Position = Vector3.new(0, -0.25 * targetSize, 1 * targetSize)} ) -- Play all tweens beam1Tween1:Play() beam1Tween2:Play() beam2Tween1:Play() beam2Tween2:Play() attachment1Tween:Play() attachment2Tween:Play() currentSize = targetSize task.wait(0.2) end end -- Function to create blue death effect local function createBlueDeathEffect(character) local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") local torso = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso") if humanoidRootPart then local deathSound = Instance.new("Sound") deathSound.Parent = humanoidRootPart deathSound.SoundId = "rbxassetid://4620904701" deathSound.Volume = 3 deathSound.Pitch = 1 deathSound.MaxDistance = 150 deathSound.MinDistance = 25000 deathSound:Play() local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.In) local goal = {Pitch = 0.25} local tween = TweenService:Create(deathSound, tweenInfo, goal) tween:Play() end if humanoidRootPart then local deathSound2 = Instance.new("Sound") deathSound2.Parent = humanoidRootPart deathSound2.SoundId = "rbxassetid://698224146" deathSound2.Volume = 2 deathSound2.Pitch = 0.8 deathSound2.MaxDistance = 150 deathSound2.MinDistance = 25000 deathSound2:Play() end -- Function to create blue particle effect local function createBlueEvaporateParticleEffect(part) local evaporate = Instance.new("ParticleEmitter") evaporate.Name = "evaporate" evaporate.ShapeStyle = Enum.ParticleEmitterShapeStyle.Surface evaporate.LightInfluence = 1 evaporate.Lifetime = NumberRange.new(1, 1) evaporate.SpreadAngle = Vector2.new(380, 380) evaporate.Transparency = NumberSequence.new(0.5) evaporate.LightEmission = 0.7 evaporate.Color = ColorSequence.new(Color3.fromRGB(0, 170, 255)) -- Blue color evaporate.Drag = 0.5 evaporate.VelocitySpread = 380 evaporate.Squash = NumberSequence.new(-3, 3) evaporate.Speed = NumberRange.new(5, 7) evaporate.Size = NumberSequence.new(1, 1.4999998) evaporate.ZOffset = 5 evaporate.ShapeInOut = Enum.ParticleEmitterShapeInOut.InAndOut evaporate.Rate = 350 evaporate.Texture = "http://www.roblox.com/asset/?id=9668592056" evaporate.ShapePartial = 0 evaporate.RotSpeed = NumberRange.new(90, 390) evaporate.Parent = part end for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") and part ~= humanoidRootPart then part.Color = Color3.fromRGB(0, 170, 255) -- Blue part.Material = Enum.Material.Neon createBlueEvaporateParticleEffect(part) local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.Out) local goal = {Transparency = 1} local tween = TweenService:Create(part, tweenInfo, goal) tween:Play() tween.Completed:Connect(function() part:Destroy() end) end end local function shrinkPart(part) if part and part:IsA("BasePart") then local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out) local goal = {Size = part.Size * 0.01} -- Shrink to 1% of original size local tween = TweenService:Create(part, tweenInfo, goal) tween:Play() end end for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") then shrinkPart(part) end end for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") and part ~= humanoidRootPart then part.Anchored = false local bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.Parent = part bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000) bodyVelocity.Velocity = Vector3.new(math.random(-10, 10), math.random(5, 15), math.random(-10, 10)) end end end -- Function to check players outside the circle and damage them local function checkPlayersInCircle() local damageConnection local active = true damageConnection = RunService.Heartbeat:Connect(function() if not active then return end local currentSize = beam1.CurveSize1 / -1.35 -- Get current circle size local center = part.Position local allPlayersDead = true local atLeastOneAlive = false for _, player in ipairs(Players:GetPlayers()) do if player.Character then local humanoid = player.Character:FindFirstChild("Humanoid") local rootPart = player.Character:FindFirstChild("HumanoidRootPart") if humanoid and rootPart and humanoid.Health > 0 then -- Ignore height for distance calculation local horizontalDistance = (Vector3.new(rootPart.Position.X, 0, rootPart.Position.Z) - Vector3.new(center.X, 0, center.Z)).Magnitude -- If player is outside the circle and hasn't died to it yet if horizontalDistance > currentSize and not deadPlayers[player] then -- Apply damage humanoid:TakeDamage(HEALTH_DRAIN_RATE * DAMAGE_CHECK_INTERVAL) -- If player dies from this damage, apply death effect and mark as dead if humanoid.Health <= 0 then deadPlayers[player] = true createBlueDeathEffect(player.Character) else allPlayersDead = false atLeastOneAlive = true end elseif deadPlayers[player] then -- Player already died to the circle allPlayersDead = allPlayersDead and true else -- Player is alive and inside the circle allPlayersDead = false atLeastOneAlive = true end end end end -- If all players have died to the circle, clean up if allPlayersDead or (not atLeastOneAlive and #Players:GetPlayers() > 0) then active = false damageConnection:Disconnect() part:Destroy() end end) end -- Enable beams after delay and start effects task.delay(APPEAR_DELAY, function() beam1.Enabled = true beam2.Enabled = true windUpEffect() task.delay(WINDUP_DURATION, shrinkEffect) -- Start checking players in circle task.spawn(checkPlayersInCircle) end) simplify and shrink to 100 lines without comments
Updated files
v1