--i really hope no logger will see what a disaster this code is!!!
--[[ UFO ]]
--[[ UFO's ATTACKS ]]
-- RiFLe
-- ( Charge attack for burst of 5 rapid fired lazers )
-- Denier
-- ( Charge for powerful n' large + shaped hitscan attack. )
-- Abid protection
-- ( Aura, that damages nearby humanoids, and makes nearby wood material burst into blue flames )
-- Abad protection
-- ( Summons a wall with humanoid, that absorbs damage, and explodes, when it dies )
-- Space light
-- ( Turns off the lights, but the eyes remain lighten up with particles )
--[[ UFO's death animation ]]
-- Summons a beam of light, dissappears into fragments
-- Tools as moves
-- I really hope thats not a bad idea bleb bleb
--[[CONFIG]]
--local owner = game:GetService("Players"):FindFirstChild(script.Name) -- needed to operate within roblos studio
local rifreltime = 0 -- reload time for RiFLe
local RBA = 5 -- amount of bullets for RiFLe
local RFREQ = 0.1 -- bullet frequency
local unanchor = false -- flag for more destruction
--[[CONFIG END]]
local tweenservice = game:GetService("TweenService") -- I HATE TWEEN SERVICE
local debris = game:GetService("Debris")
local character = owner.Character
local rifle = Instance.new("Tool")
rifle.Parent = owner.Backpack
rifle.RequiresHandle = false
rifle.Name = [[RiFLe
(Ready)]]
local function shoot()
local bullet = Instance.new("Part")
local ParticleEmitter1 = Instance.new("ParticleEmitter")
local attachment = Instance.new("Attachment")
attachment.Parent = bullet
bullet.Name = "Bullet"
bullet.Parent = workspace
bullet.Color = Color3.new(1, 1, 1)
bullet.Transparency = 0.99
bullet.CanCollide = false
bullet.Size = Vector3.new(1.2, 1.2, 1.2)
bullet.BottomSurface = Enum.SurfaceType.Smooth
bullet.BrickColor = BrickColor.new("Lily white")
bullet.Material = Enum.Material.Neon
bullet.TopSurface = Enum.SurfaceType.Smooth
ParticleEmitter1.Parent = attachment
ParticleEmitter1.Speed = NumberRange.new(0, 0)
ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.513726, 0.960784, 1),Color3.new(0.513726, 0.960784, 1))
ParticleEmitter1.LightInfluence = 10
ParticleEmitter1.Transparency = NumberSequence.new(1,0,1)
ParticleEmitter1.Size = NumberSequence.new(2.3125,0)
ParticleEmitter1.Drag = 10
ParticleEmitter1.EmissionDirection = Enum.NormalId.Back
ParticleEmitter1.Lifetime = NumberRange.new(0.1, 0.1)
ParticleEmitter1.Rate = 1000
local PointLight0 = Instance.new("PointLight")
PointLight0.Parent = bullet
PointLight0.Range = 8
PointLight0.Brightness = 5
PointLight0.Color = Color3.new(1, 1, 1)
local Sound0 = Instance.new("Sound")
Sound0.Parent = bullet
Sound0.Looped = true
Sound0.PlaybackSpeed = 2
Sound0.SoundId = "rbxassetid://12222095"
Sound0:Play()
local chorus = Instance.new("ChorusSoundEffect")
chorus.Parent = Sound0
chorus.Mix = 10
local shot1 = Instance.new("Sound")
shot1.Parent = bullet
shot1.PlayOnRemove = true
shot1.SoundId = "rbxassetid://54516144"
shot1.Pitch = 1.2
shot1:Destroy()
local boom = Instance.new("Sound")
boom.Parent = bullet
boom.PlayOnRemove = true
boom.SoundId = "rbxassetid://878211907"
boom.Pitch = 1.2
boom.Volume = 2
local bodyForce = Instance.new('BodyForce', bullet)
bodyForce.Force = Vector3.new(0, (bullet:GetMass() * workspace.Gravity), 0)
bullet:SetNetworkOwner(nil)
local function onRiProjTouched(hit)
if hit.Name == "Bullet" or hit.Parent == owner.Character or hit.Name == "Handle" then return end
local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
if hum then
hum:TakeDamage(10)
elseif hit.Anchored == false or unanchor then
if unanchor then
hit.Anchored = false
end
hit:BreakJoints()
hit.Velocity = bullet.Velocity
end
local hpp = Instance.new("Part") -- hit posistion part
hpp.Name = "Bullet"
hpp.Parent = workspace
hpp.Size = Vector3.new(1,1,1)
hpp.Position = bullet.Position
hpp.Anchored = true
hpp.Transparency = 1
hpp.CanCollide = false
local RHF = Instance.new("ParticleEmitter") -- RiFLe hit effect
RHF.Parent = hpp
RHF.Speed = NumberRange.new(0, 0)
RHF.Color = ColorSequence.new(Color3.new(0.513726, 0.960784, 1),Color3.new(0.513726, 0.960784, 1))
RHF.LightInfluence = 10
RHF.Transparency = NumberSequence.new(0,0)
RHF.Size = NumberSequence.new{NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(0.05, 10),NumberSequenceKeypoint.new(1, 0)}
RHF.Drag = 10
RHF.EmissionDirection = Enum.NormalId.Back
RHF.Lifetime = NumberRange.new(0.5, 0.5)
RHF.Rate = 0
RHF:Emit(1)
local PointLight0 = Instance.new("PointLight")
PointLight0.Parent = hpp
PointLight0.Range = 8
PointLight0.Brightness = 7
PointLight0.Color = Color3.new(1, 1, 1)
local pltween = tweenservice:Create(PointLight0,TweenInfo.new(0.3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,1,false,0),{Brightness = 0})
pltween:Play()
debris:AddItem(hpp,1)
bullet:Destroy()
end
bullet.Touched:Connect(onRiProjTouched)
bullet.Position = character.Head.Position
bullet.Rotation = character.Head.Rotation
bullet:ApplyImpulse(character.Head.CFrame.LookVector * 200)
debris:AddItem(bullet, 5)
end
local function TWAU(toolobj,waittime) -- Tool Wait And Update
local splittabl = toolobj.Name:split([[ ]])
local trtoolname = splittabl[1]
for i = 1,waittime*1 do
toolobj.Name = trtoolname..[[ (]]..tostring(waittime-(i/1))..")"
task.wait(1)
end
toolobj.Name = trtoolname..[[
(Ready)]]
end
local function STM(name) -- set tool move
MoveBox.Text = "["..name.."]"
if name ~= "None" then
local ms = Instance.new("Sound")
ms.SoundId = "rbxassetid://9060399229"
ms.Parent = owner.Character.Head
ms.Volume = 1
ms.PlayOnRemove = true
ms:Destroy()
end
end
local function onRifleActivated()
if not rifle.Enabled then return end
rifle.Enabled = false
STM("RiFLe")
for i = 1,RBA do
shoot()
task.wait(RFREQ)
end
TWAU(rifle,rifreltime)
STM("None")
rifle.Enabled = true
end
rifle.Activated:Connect(onRifleActivated)
--Setting up heath system
BillboardGui0 = Instance.new("BillboardGui")
NameBox = Instance.new("TextBox")
MoveBox = Instance.new("TextBox")
HealthBox = Instance.new("TextBox")
BillboardGui0.Parent = character.Head
BillboardGui0.LightInfluence = 0
BillboardGui0.Size = UDim2.new(20, 0, 3, 0)
BillboardGui0.Active = true
BillboardGui0.ClipsDescendants = true
BillboardGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
BillboardGui0.ExtentsOffset = Vector3.new(0, 5, 0)
NameBox.Name = "Name"
NameBox.Parent = BillboardGui0
NameBox.Size = UDim2.new(1, 0, 0.333333343, 0)
NameBox.BackgroundColor = BrickColor.new("Black metallic")
NameBox.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
NameBox.BackgroundTransparency = 0.800000011920929
NameBox.BorderSizePixel = 0
NameBox.Font = Enum.Font.Ubuntu
NameBox.FontSize = Enum.FontSize.Size14
NameBox.TextColor = BrickColor.new("Dark green")
NameBox.TextColor3 = Color3.new(0, 0.690196, 0.286275)
NameBox.TextScaled = true
NameBox.TextSize = 14
NameBox.TextStrokeTransparency = 0
NameBox.TextWrap = true
NameBox.TextWrapped = true
NameBox.MultiLine = true
NameBox.ShowNativeInput = false
MoveBox.Name = "Move"
MoveBox.Parent = BillboardGui0
MoveBox.Position = UDim2.new(0, 0, 0.333330005, 0)
MoveBox.Size = UDim2.new(1, 0, 0.333333343, 0)
MoveBox.BackgroundColor = BrickColor.new("Black metallic")
MoveBox.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
MoveBox.BackgroundTransparency = 0.800000011920929
MoveBox.BorderSizePixel = 0
MoveBox.Font = Enum.Font.Ubuntu
MoveBox.FontSize = Enum.FontSize.Size14
MoveBox.TextColor = BrickColor.new("Dark green")
MoveBox.TextColor3 = Color3.new(0, 0.690196, 0.286275)
MoveBox.TextScaled = true
MoveBox.TextSize = 14
MoveBox.TextStrokeTransparency = 0
MoveBox.TextWrap = true
MoveBox.TextWrapped = true
MoveBox.MultiLine = true
MoveBox.ShowNativeInput = false
HealthBox.Name = "Health"
HealthBox.Parent = BillboardGui0
HealthBox.Position = UDim2.new(0, 0, 0.666000009, 0)
HealthBox.Size = UDim2.new(1, 0, 0.333333343, 0)
HealthBox.BackgroundColor = BrickColor.new("Black metallic")
HealthBox.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
HealthBox.BackgroundTransparency = 0.800000011920929
HealthBox.BorderSizePixel = 0
HealthBox.Font = Enum.Font.Ubuntu
HealthBox.FontSize = Enum.FontSize.Size14
HealthBox.TextColor = BrickColor.new("Dark green")
HealthBox.TextColor3 = Color3.new(0, 0.690196, 0.286275)
HealthBox.TextScaled = true
HealthBox.TextSize = 14
HealthBox.TextStrokeTransparency = 0
HealthBox.TextWrap = true
HealthBox.TextWrapped = true
HealthBox.MultiLine = true
HealthBox.ShowNativeInput = false
STM("None")
--Setting up the character
character.Torso["Left Hip"].C0 = CFrame.new(0,-1.5,1) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
character.Torso["Left Hip"].C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(90),0)
local hit = Instance.new("Sound", owner.Character.Head)
hit.Pitch = 1
hit.SoundId = "rbxassetid://1455817260"
hit.Volume = 0.5
character.Humanoid.MaxHealth = 500
character.Humanoid.Health = 500
character.Torso["Left Shoulder"].C0 = CFrame.new(0,1.5,1) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
character.Torso["Left Shoulder"].C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(270),math.rad(90),0)
character.Torso["Right Shoulder"].C0 = CFrame.new(-1.5,0,1) * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)
character.Torso["Right Shoulder"].C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(180),math.rad(90),0)
character.Torso["Right Hip"].C0 = CFrame.new(1.5,0,1) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
character.Torso["Right Hip"].C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(180),math.rad(90),0)
character.Torso["Neck"].C0 = CFrame.new(0,0,-1) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
character.Torso["Neck"].C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(180),math.rad(-90))
character.HumanoidRootPart.RootJoint.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0))
character.HumanoidRootPart.RootJoint.C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(90), math.rad(0))
character.Torso.CustomPhysicalProperties = PhysicalProperties.new(100,0,0,100,100)
character.HumanoidRootPart.Size = Vector3.new(2, 5, 1)
character.Humanoid.WalkSpeed = 100
character.Humanoid.JumpHeight = 25
character.Humanoid.JumpPower = 50
character.Animate:Destroy()
-- Create ambience
local amb = Instance.new("Sound")
amb.Parent = character.Head
amb.SoundId = "rbxassetid://162670130"
amb.Volume = 0.5
amb.Looped = true
amb:Play()
local scf = 120
local bgscf = 0
--Logic
character.Humanoid.HealthChanged:Connect(function(health)
print(character.Humanoid.Health - health)
if character.Humanoid.Health - health > 0 then
hit:Play()
end
end)
while true do
--Ambience pitch + spins when moves
task.wait()
local ambtween = tweenservice:Create(amb,TweenInfo.new(0.02,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 1, false,0),{Pitch = character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude / (scf * 2) + bgscf})
ambtween:Play()
local roottween = tweenservice:Create(character.HumanoidRootPart.RootJoint, TweenInfo.new(0.02,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 1, false,0), {C1 = character.HumanoidRootPart.RootJoint.C1 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude * 10 / scf), math.rad(0))})
local headtween = tweenservice:Create(character.Torso["Neck"], TweenInfo.new(0.02,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 1, false,0), {C1 = character.Torso["Neck"].C1 * CFrame.fromEulerAnglesXYZ(math.rad(0),math.rad(0),math.rad(character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude * 10 / scf))})
ambtween:Play()
roottween:Play()
headtween:Play()
--Health display
healthamm = string.rep("I",character.Humanoid.Health / 10)
condt = character.Humanoid.MaxHealth - character.Humanoid.Health
HealthBox.Text = "["..healthamm.."]"
--amb.Pitch = character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude / (scf * 2) + bgscf
--character.HumanoidRootPart.RootJoint.C1 *= CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude * 10 / scf), math.rad(0))
--character.Torso["Neck"].C1 *= CFrame.fromEulerAnglesXYZ(math.rad(0),math.rad(0),math.rad(character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude * 10 / scf))
end