Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- PointLight3 = Instance.new("PointLight")
- ParticleEmitter4 = Instance.new("ParticleEmitter")
- Sound5 = Instance.new("Sound")
- Sound6 = Instance.new("Sound")
- Sound7 = Instance.new("Sound")
- Sound8 = Instance.new("Sound")
- LocalScript9 = Instance.new("LocalScript")
- LocalScript10 = Instance.new("LocalScript")
- Animation11 = Instance.new("Animation")
- Animation12 = Instance.new("Animation")
- Animation13 = Instance.new("Animation")
- Script14 = Instance.new("Script")
- ScreenGui15 = Instance.new("ScreenGui")
- Frame16 = Instance.new("Frame")
- Frame17 = Instance.new("Frame")
- Frame18 = Instance.new("Frame")
- Frame19 = Instance.new("Frame")
- Frame20 = Instance.new("Frame")
- TextLabel21 = Instance.new("TextLabel")
- Script22 = Instance.new("Script")
- Tool0.Name = "Mystical Staff of Cyan Lightning Magic"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=276092020"
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Rotation = Vector3.new(43.5200005, 89.9399948, 0.119999997)
- Part1.Locked = true
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(0.5, 6, 0.5)
- Part1.CFrame = CFrame.new(-28.4999981, 2.34399509, 152.000427, 0.00102147646, -2.19987669e-06, 0.999999404, 0.690043509, 0.723767221, -0.000703365542, -0.723767221, 0.690043867, 0.000740786083)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(-28.4999981, 2.34399509, 152.000427)
- Part1.Orientation = Vector3.new(0.0399999991, 89.9599991, 43.6299973)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=276091747"
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=276091966"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- PointLight3.Parent = Part1
- PointLight3.Color = Color3.new(0, 1, 1)
- PointLight3.Brightness = 50
- PointLight3.Range = 6
- PointLight3.Color = Color3.new(0, 1, 1)
- ParticleEmitter4.Name = "Particles"
- ParticleEmitter4.Parent = Part1
- ParticleEmitter4.Transparency = NumberSequence.new(0.60000002384186,0.60000002384186)
- ParticleEmitter4.Rotation = NumberRange.new(0, 5)
- ParticleEmitter4.Size = NumberSequence.new(0.31999999284744,1.1799999475479,1.25)
- ParticleEmitter4.Color = ColorSequence.new(Color3.new(0, 1, 1),Color3.new(0, 0.666667, 1))
- ParticleEmitter4.LightEmission = 1
- ParticleEmitter4.Texture = "rbxasset://textures/particles/fire_main.dds"
- ParticleEmitter4.Acceleration = Vector3.new(0, 10, 0)
- ParticleEmitter4.Lifetime = NumberRange.new(0.20000000298023, 0.30000001192093)
- ParticleEmitter4.Rate = 1000
- ParticleEmitter4.RotSpeed = NumberRange.new(15, 25)
- ParticleEmitter4.Speed = NumberRange.new(-0.25, -0.25)
- ParticleEmitter4.Color = ColorSequence.new(Color3.new(0, 1, 1),Color3.new(0, 0.666667, 1))
- Sound5.Name = "Strike"
- Sound5.Parent = Part1
- Sound5.Pitch = 2
- Sound5.SoundId = "http://www.roblox.com/asset/?id=115327352"
- Sound5.Volume = 0.73460847139359
- Sound5.Looped = true
- Sound6.Name = "Lightning"
- Sound6.Parent = Part1
- Sound6.SoundId = "http://www.roblox.com/asset/?id=156190087"
- Sound6.Volume = 1
- Sound7.Name = "Zap"
- Sound7.Parent = Part1
- Sound7.Pitch = 1.25
- Sound7.SoundId = "http://www.roblox.com/asset/?id=156190087"
- Sound7.Volume = 1
- Sound8.Name = "Lightning2"
- Sound8.Parent = Part1
- Sound8.SoundId = "http://www.roblox.com/asset/?id=96478426"
- Sound8.Volume = 1
- LocalScript9.Parent = Tool0
- table.insert(cors,sandbox(LocalScript9,function()
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- RunService = game:GetService("RunService")
- ContentProvider = game:GetService("ContentProvider")
- RbxUtility = LoadLibrary("RbxUtility")
- Create = RbxUtility.Create
- Animations = {}
- ServerControl = Tool:WaitForChild("ServerControl")
- ClientControl = Tool:WaitForChild("ClientControl")
- Rate = (1 / 60)
- MobilityDisabled = false
- ToolEquipped = false
- function SetAnimation(mode, value)
- if not ToolEquipped or not CheckIfAlive() then
- return
- end
- local function StopAnimation(Animation)
- for i, v in pairs(Animations) do
- if v.Animation == Animation then
- v.AnimationTrack:Stop(value.EndFadeTime)
- for i, v in pairs({v.KeyframeReached, v.TrackStopped}) do
- if v then
- v:disconnect()
- end
- end
- table.remove(Animations, i)
- end
- end
- end
- if mode == "PlayAnimation" then
- for i, v in pairs(Animations) do
- if v.Animation == value.Animation then
- if value.Speed then
- v.AnimationTrack:AdjustSpeed(value.Speed)
- return
- elseif value.Weight or value.FadeTime then
- v.AnimationTrack:AdjustWeight(value.Weight, value.FadeTime)
- return
- else
- StopAnimation(value.Animation, false)
- end
- end
- end
- local AnimationMonitor = Create("Model"){}
- local TrackEnded = Create("StringValue"){Name = "Ended"}
- local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
- local TrackStopped, KeyframeReached
- if value.PauseAt then
- KeyframeReached = AnimationTrack.KeyframeReached:connect(function(Keyframe)
- if Keyframe == value.PauseAt then
- AnimationTrack:AdjustSpeed(0)
- if KeyframeReached then
- KeyframeReached:disconnect()
- end
- end
- end)
- end
- if not value.Manual then
- TrackStopped = AnimationTrack.Stopped:connect(function()
- if TrackStopped then
- TrackStopped:disconnect()
- end
- StopAnimation(value.Animation, true)
- TrackEnded.Parent = AnimationMonitor
- end)
- end
- table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack, KeyframeReached = KeyframeReached, TrackStopped = TrackStopped})
- AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
- if TrackStopped then
- AnimationMonitor:WaitForChild(TrackEnded.Name)
- end
- return TrackEnded.Name
- elseif mode == "StopAnimation" and value then
- StopAnimation(value.Animation)
- end
- end
- function DisableMobility(Boolean)
- if Boolean and MobilityDisabled then
- return
- end
- if MobilityDisabler then
- MobilityDisabler:disconnect()
- end
- MobilityDisabled = Boolean
- if MobilityDisabled then
- Humanoid.AutoRotate = false
- Humanoid.WalkSpeed = 0
- MobilityDisabler = Humanoid.Changed:connect(function(Property)
- Humanoid.Jump = false
- Humanoid.AutoRotate = false
- Humanoid.WalkSpeed = 0
- end)
- else
- Humanoid.AutoRotate = true
- Humanoid.WalkSpeed = 16
- end
- end
- function CheckIfAlive()
- return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- ToolEquipped = true
- if not CheckIfAlive() then
- return
- end
- Spawn(function()
- PlayerMouse = Player:GetMouse()
- Mouse.Button1Down:connect(function()
- InvokeServer("Button1Click", {Down = true})
- end)
- Mouse.Button1Up:connect(function()
- InvokeServer("Button1Click", {Down = false})
- end)
- Mouse.KeyDown:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = true})
- end)
- Mouse.KeyUp:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = false})
- end)
- for i, v in pairs(Tool:GetChildren()) do
- if v:IsA("Animation") then
- ContentProvider:Preload(v.AnimationId)
- end
- end
- end)
- end
- function Unequipped()
- for i, v in pairs(Animations) do
- if v and v.AnimationTrack then
- v.AnimationTrack:Stop()
- end
- end
- DisableMobility(false)
- Animations = {}
- ToolEquipped = false
- end
- function InvokeServer(mode, value)
- local ServerReturn = nil
- pcall(function()
- ServerReturn = ServerControl:InvokeServer(mode, value)
- end)
- return ServerReturn
- end
- function OnClientInvoke(mode, value)
- if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
- SetAnimation("PlayAnimation", value)
- elseif mode == "StopAnimation" and value then
- SetAnimation("StopAnimation", value)
- elseif mode == "PlaySound" and value then
- value:Play()
- elseif mode == "StopSound" and value then
- value:Stop()
- elseif mode == "MousePosition" then
- return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
- elseif mode == "SetMouse" then
- pcall(function()
- Mouse[value.Property] = value.Value
- end)
- elseif mode == "DisableMobility" then
- local Disabled = value.Disabled
- DisableMobility(value.Disabled)
- end
- end
- ClientControl.OnClientInvoke = OnClientInvoke
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end))
- LocalScript10.Name = "MouseIcon"
- LocalScript10.Parent = Tool0
- table.insert(cors,sandbox(LocalScript10,function()
- --Made by Luckymaxer
- Mouse_Icon = "rbxasset://textures/GunCursor.png"
- Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
- Tool = script.Parent
- Mouse = nil
- function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
- end
- end
- function OnEquipped(ToolMouse)
- Mouse = ToolMouse
- UpdateIcon()
- end
- function OnChanged(Property)
- if Property == "Enabled" then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end))
- Animation11.Name = "Blast"
- Animation11.Parent = Tool0
- Animation11.AnimationId = "http://www.roblox.com/asset/?id=277780975"
- Animation12.Name = "ArmsUp"
- Animation12.Parent = Tool0
- Animation12.AnimationId = "http://www.roblox.com/asset/?id=280211525"
- Animation13.Name = "Spin"
- Animation13.Parent = Tool0
- Animation13.AnimationId = "http://www.roblox.com/asset/?id=232937965"
- Script14.Parent = Tool0
- table.insert(cors,sandbox(Script14,function()
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- RunService = game:GetService("RunService")
- LightningFunctions = require(script:WaitForChild("LightningFunctions"))
- RbxUtility = LoadLibrary("RbxUtility")
- Create = RbxUtility.Create
- BaseUrl = "http://www.roblox.com/asset/?id="
- Gravity = 196.20
- Rate = (1 / 60)
- BasePart = Create("Part"){
- Material = Enum.Material.Plastic,
- Shape = Enum.PartType.Block,
- TopSurface = Enum.SurfaceType.Smooth,
- BottomSurface = Enum.SurfaceType.Smooth,
- FormFactor = Enum.FormFactor.Custom,
- Size = Vector3.new(0.2, 0.2, 0.2),
- CanCollide = true,
- Locked = true,
- }
- ManaBar = script:WaitForChild("ManaBar")
- Animations = {
- Blast = {Animation = Tool:WaitForChild("Blast"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 1.5, PauseAt = "Complete"},
- ArmsUp = {Animation = Tool:WaitForChild("ArmsUp"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 1},
- Spin = {Animation = Tool:WaitForChild("Spin"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 0.5},
- }
- Sounds = {
- Lightning = Handle:WaitForChild("Lightning"),
- Lightning2 = Handle:WaitForChild("Lightning2"),
- Strike = Handle:WaitForChild("Strike"),
- Zap = Handle:WaitForChild("Zap"),
- }
- CurrentMana = Create("DoubleConstrainedValue"){
- MinValue = 0,
- MaxValue = 0,
- }
- CurrentMana.Value = (CurrentMana.MaxValue * 0.75)
- ManaCharging = Create("BoolValue"){
- Value = false,
- }
- InUse = Create("BoolValue"){
- Value = false,
- }
- MouseDown = Create("BoolValue"){
- Value = false,
- }
- ToolEquipped = Create("BoolValue"){
- Value = false,
- }
- ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
- Name = "ServerControl",
- Parent = Tool,
- })
- ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
- Name = "ClientControl",
- Parent = Tool,
- })
- Handle.Transparency = 0
- Tool.Enabled = true
- function IsTeamMate(Player1, Player2)
- return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
- end
- function TagHumanoid(humanoid, player)
- local Creator_Tag = Create("ObjectValue"){
- Name = "creator",
- Value = player,
- }
- Debris:AddItem(Creator_Tag, 2)
- Creator_Tag.Parent = humanoid
- end
- function UntagHumanoid(humanoid)
- for i, v in pairs(humanoid:GetChildren()) do
- if v:IsA("ObjectValue") and v.Name == "creator" then
- v:Destroy()
- end
- end
- end
- function TakeDamage(humanoid, Damage)
- if not humanoid or not humanoid:IsA("Humanoid") or not Damage or not Player then
- return
- end
- local character = humanoid.Parent
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("ForceField") then
- return
- end
- end
- local player = Players:GetPlayerFromCharacter(Character)
- if player then
- if IsTeamMate(Player, player) then
- return
- end
- CurrentMana.Value = CurrentMana.Value + (CurrentMana.MaxValue * 0.02)
- end
- TagHumanoid(humanoid, Player)
- humanoid:TakeDamage(Damage)
- UntagHumanoid(humanoid)
- end
- function Clamp(Number, Min, Max)
- return math.max(math.min(Max, Number), Min)
- end
- function GetPercentage(Start, End, Number)
- return (((Number - Start) / (End - Start)) * 100)
- end
- function Round(Number, RoundDecimal)
- local WholeNumber, Decimal = math.modf(Number)
- return ((Decimal >= RoundDecimal and math.ceil(Number)) or (Decimal < RoundDecimal and math.floor(Number)))
- end
- function MakeCircle(Origin, Radius, Parts)
- local Circle = Create("Model"){
- Name = "Circle",
- }
- for i = 1, Parts do
- local Part = BasePart:Clone()
- Part.Name = "Effect"
- Part.Transparency = 1
- Part.Size = Vector3.new(6, 0.2, (Radius * 2))
- Part.Anchored = true
- Part.CanCollide = false
- Part.CFrame = (Origin * CFrame.Angles(0, ((math.pi * 2) / (Parts / i)), 0))
- Part.CFrame = (Part.CFrame + Part.CFrame.lookVector * (Radius / 2))
- Part.Parent = Circle
- end
- return Circle
- end
- function CheckTableForInstance(Table, Instance)
- for i, v in pairs(Table) do
- if v == Instance then
- return true
- end
- end
- return false
- end
- function GetAllConnectedParts(Object)
- local Parts = {}
- local function GetConnectedParts(Object)
- for i, v in pairs(Object:GetConnectedParts()) do
- local Ignore = false
- for ii, vv in pairs(Parts) do
- if v == vv then
- Ignore = true
- end
- end
- if not Ignore then
- table.insert(Parts, v)
- GetConnectedParts(v)
- end
- end
- end
- GetConnectedParts(Object)
- return Parts
- end
- function GetTotalParts(MaxParts, PossibleParts, Parts)
- if MaxParts < PossibleParts then
- return MaxParts
- elseif Parts >= MaxParts then
- return 0
- elseif MaxParts >= PossibleParts then
- local PartCount = (MaxParts - PossibleParts)
- if Parts <= MaxParts then
- PartCount = (MaxParts - Parts)
- if PartCount > PossibleParts then
- return PossibleParts
- else
- return PartCount
- end
- elseif PartCount >= PossibleParts then
- return PossibleParts
- else
- return PartCount
- end
- end
- end
- function GetParts(Region, MaxParts, Ignore)
- local Parts = {}
- local RerunFailed = false
- while #Parts < MaxParts and not RerunFailed do
- local Region = Region
- local PossibleParts = GetTotalParts(MaxParts, 100, #Parts)
- local PartsNearby = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region, Ignore, PossibleParts)
- if #PartsNearby == 0 then
- RerunFailed = true
- else
- for i, v in pairs(PartsNearby) do
- table.insert(Parts, v)
- table.insert(Ignore, v)
- end
- end
- end
- return Parts
- end
- function GetNearbyObjects(Region)
- local IgnoreList = {Character}
- for i, v in pairs(Players:GetChildren()) do
- if v:IsA("Player") and v ~= Player and v.Character and v.Character.Parent and IsTeamMate(Player, v) then
- table.insert(IgnoreList, v.Character)
- end
- end
- return GetParts(Region, 500, IgnoreList)
- end
- function ManageMana(Gui)
- local Mana = {}
- if not Gui then
- return
- end
- local Frame = Gui:FindFirstChild("Frame")
- if not Frame then
- return
- end
- local Bar = Frame:FindFirstChild("Bar")
- if not Bar then
- return
- end
- local function AdjustBar()
- local ChargePercent = (GetPercentage(0, 100, CurrentMana.Value) * 0.01)
- local NewMana = Clamp((Frame.AbsoluteSize.X * ChargePercent), 0, Frame.AbsoluteSize.X)
- Bar.Size = (UDim2.new(Bar.Size.X.Scale, 0, Bar.Size.Y.Scale, Bar.Size.Y.Offset) + UDim2.new(0, NewMana, 0, 0))
- end
- for i, v in pairs({ToolUnequipped, ManaAltered}) do
- if v then
- v:disconnect()
- end
- end
- local CurrentlyEquipped = true
- ToolUnequipped = Tool.Unequipped:connect(function()
- CurrentlyEquipped = false
- end)
- ManaAltered = CurrentMana.Changed:connect(function()
- AdjustBar()
- end)
- function Mana:UseMana(Amount)
- CurrentMana.Value = (CurrentMana.Value - Amount)
- if CurrentMana.Value < CurrentMana.MaxValue and not ManaCharging.Value then
- ManaCharging.Value = true
- end
- end
- AdjustBar()
- return Mana
- end
- function ChargeMana()
- --[[if not ManaCharging.Value then
- return
- end]]
- Spawn(function()
- local ChargeTimeRate = 0.001
- local ChargeRate = 0.001
- local ChargePercent = 100
- while --[[ManaCharging.Value and CurrentMana.Value < CurrentMana.MaxValue]]true do
- wait(ChargeTimeRate)
- --if not InUse.Value then
- CurrentMana.Value = (CurrentMana.Value + ((CurrentMana.MaxValue * ChargePercent) * ChargeRate))
- --end
- end
- --ManaCharging.Value = false
- end)
- end
- function CreateStaff(CreateNew)
- for i, v in pairs(Tool:GetChildren()) do
- if v:IsA("BasePart") and v ~= Handle then
- v:Destroy()
- end
- end
- Handle.Transparency = ((CreateNew and 1) or 0)
- if not CreateNew then
- return
- end
- Staff = BasePart:Clone()
- Staff.Name = "Staff"
- Staff.Size = Vector3.new(0.5, 6, 0.5)
- Staff.CanCollide = false
- local Mesh = Create("SpecialMesh"){
- Name = "Mesh",
- MeshType = Enum.MeshType.FileMesh,
- MeshId = (BaseUrl .. "276091843"),
- TextureId = (BaseUrl .. "276091966"),
- Scale = Vector3.new(1, 1, 1),
- Parent = Staff,
- }
- GripPiece = Staff:Clone()
- GripPiece.Name = "GripPiece"
- GripPiece.Size = Vector3.new(0.5, 1.5, 0.5)
- GripPiece.Mesh.MeshId = (BaseUrl .. "276091878")
- Orb = Staff:Clone()
- Orb.Name = "Orb"
- Orb.Size = Vector3.new(0.2, 0.2, 0.2)
- Orb.Mesh.MeshId = (BaseUrl .. "276091920")
- local Joints = {
- {Class = "Weld", Parent = Staff, Properties = {Part0 = Handle, Part1 = Staff, C0 = CFrame.new(0, 0, 0), C1 = CFrame.new(0, 0, 0)}},
- {Class = "Weld", Parent = Staff, Properties = {Part0 = Staff, Part1 = GripPiece, C0 = CFrame.new(-0.05, 1.925, -0.0375), C1 = CFrame.new(0, 0, 0)}},
- {Class = "Motor6D", Parent = Staff, Properties = {Part0 = GripPiece, Part1 = Orb, MaxVelocity = 0.05, DesiredAngle = 99999999, C0 = CFrame.new(-0.0225, 0.3, 0.0275), C1 = CFrame.new(0, 0, 0)}},
- }
- for i, v in pairs(Joints) do
- local Joint = Create(v.Class){}
- for ii, vv in pairs(v.Properties) do
- Joint[ii] = vv
- end
- Joint.Parent = v.Parent
- end
- for i, v in pairs({Staff, GripPiece, Orb}) do
- v.Parent = Tool
- end
- end
- function CheckIfAlive()
- return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
- end
- function Activated()
- if not Tool.Enabled or not ToolEquipped.Value or MouseDown.Value or not CheckIfAlive() or InUse.Value then
- return
- end
- Tool.Enabled = false
- MouseDown.Value = true
- local CurrentlyEquipped = true
- local CurrentlyDown = true
- local ToolUnequipped = Tool.Unequipped:connect(function()
- CurrentlyEquipped = false
- end)
- local MouseButtonUp = MouseDown.Changed:connect(function()
- if not MouseDown.Value then
- CurrentlyDown = false
- end
- end)
- InUse.Value = true
- Sounds.Lightning:Play()
- Delay(0.25, (function()
- for i, v in pairs({ToolUnequipped, MouseButtonUp}) do
- if v then
- v:disconnect()
- end
- end
- if CurrentlyEquipped and CurrentlyDown and CheckIfAlive() then
- Sounds.Strike:Play()
- end
- end))
- local ManaCost = 0
- local MaxDuration = 5
- local StartTime = tick()
- local StrikeCount = 0
- local LightningDamage = 999999999
- local FireRate = 0.001
- local LightningReloadTime = 0.001
- while CheckIfAlive() and ToolEquipped.Value and MouseDown.Value and Orb.Parent --[[and (tick() - StartTime) <= MaxDuration]] and CurrentMana.Value >= ManaCost do
- StrikeCount = (StrikeCount + 1)
- if StrikeCount > 1 then
- ManaUsage:UseMana(ManaCost)
- end
- Sounds.Strike.Volume = (((math.sin(tick() * 3) + 1) * 0.25) + 0.25)
- local MousePosition = InvokeClient("MousePosition")
- if MousePosition then
- MousePosition = MousePosition.Position
- LightningFunctions.RemoveLightning()
- local RayData = LightningFunctions.Zap({StartPosition = Orb.Position, TargetPosition = MousePosition, Character = Character, Color = "Cyan", Individual = false})
- if RayData then
- local RayHit = RayData.RayHit
- if RayHit then
- local character = RayHit.Parent
- if character == Character then
- return
- end
- if character:IsA("Hat") then
- character = character.Parent
- end
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player or (player and not IsTeamMate(Player, player)) then
- UntagHumanoid(humanoid)
- TagHumanoid(humanoid, Player)
- humanoid:TakeDamage(LightningDamage)
- end
- end
- end
- Spawn(function()
- InvokeClient("SetMouse", {Property = "TargetFilter", Value = RayData.LightningModel})
- end)
- end
- end
- wait(FireRate)
- end
- InUse.Value = false
- Sounds.Strike:Stop()
- if StrikeCount > 1 then
- wait(LightningReloadTime)
- else
- wait(LightningReloadTime / 4)
- end
- Tool.Enabled = true
- end
- function ResetStuff()
- for i, v in pairs({ManaBarCopy, ManaAltered, ToolUnequipped}) do
- if v then
- if tostring(v) == "Connection" then
- v:disconnect()
- elseif type(v) == "userdata" and v.Parent then
- v:Destroy()
- end
- end
- end
- for i, v in pairs(Sounds) do
- v:Stop()
- end
- for i, v in pairs({InUse, MouseDown}) do
- v.Value = false
- end
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Humanoid = Character:FindFirstChild("Humanoid")
- Torso = Character:FindFirstChild("Torso")
- Player = Players:GetPlayerFromCharacter(Character)
- if not CheckIfAlive() then
- return
- end
- Spawn(function()
- EquipTick = tick()
- ResetStuff()
- --[[if CurrentMana.Value >= (CurrentMana.MaxValue * 0.8) then
- CurrentMana.Value = (CurrentMana.MaxValue * 0.8)
- end]]
- CreateStaff(true)
- local PlayerGui = Player:FindFirstChild("PlayerGui")
- if PlayerGui then
- ManaBarCopy = ManaBar:Clone()
- ManaUsage = ManageMana(ManaBarCopy)
- ManaBarCopy.Parent = PlayerGui
- end
- end)
- ToolEquipped.Value = true
- end
- function Unequipped()
- ResetStuff()
- CreateStaff(false)
- ToolEquipped.Value = false
- end
- function OnServerInvoke(player, mode, value)
- if player ~= Player or not ToolEquipped.Value or not value or not CheckIfAlive() then
- return
- end
- if mode == "Button1Click" then
- local Down = value.Down
- if not Down and MouseDown.Value then
- MouseDown.Value = false
- end
- elseif mode == "KeyPress" then
- local Key = value.Key
- local Down = value.Down
- if Down and Tool.Enabled and not InUse.Value then
- if Key == "z" then
- local ManaCost = 0
- if CurrentMana.Value < ManaCost or (tick() - EquipTick) < 5 then
- return
- end
- ManaUsage:UseMana(ManaCost)
- Tool.Enabled = false
- InUse.Value = true
- local PlayersNearby = {}
- for i, v in pairs(Players:GetChildren()) do
- if v:IsA("Player") and v ~= Player and not IsTeamMate(Player, v) and v.Character then
- local character = v.Character
- local ForceField = nil
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("ForceField") then
- ForceField = v
- break
- end
- end
- if not ForceField then
- local torso = character:FindFirstChild("Torso")
- table.insert(PlayersNearby, v)
- end
- end
- end
- local ClosestPlayer = {Player = nil, Distance = 40}
- for i, v in pairs(PlayersNearby) do
- local character = v.Character
- local torso = character:FindFirstChild("Torso")
- if torso then
- local DistanceApart = (Torso.Position - torso.Position).Magnitude
- if DistanceApart < ClosestPlayer.Distance then
- ClosestPlayer.Player = character
- ClosestPlayer.Distance = DistanceApart
- end
- end
- end
- if not ClosestPlayer.Player then
- local HumanoidsHit = {}
- local NPCsNearby = {}
- local LightningRadius = ClosestPlayer.Distance
- local LightningRegion = Region3.new((Torso.Position - Vector3.new(LightningRadius, LightningRadius, LightningRadius)), (Torso.Position + Vector3.new(LightningRadius, LightningRadius, LightningRadius)))
- for i, v in pairs(GetNearbyObjects(LightningRegion)) do
- if v and v.Parent then
- local character = v.Parent
- if character ~= Character then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player then
- if not CheckTableForInstance(HumanoidsHit, humanoid) then
- local ForceField = nil
- for ii, vv in pairs(character:GetChildren()) do
- if vv:IsA("ForceField") then
- ForceField = vv
- break
- end
- end
- if not ForceField then
- table.insert(NPCsNearby, character)
- end
- end
- end
- end
- end
- end
- end
- for i, v in pairs(NPCsNearby) do
- local torso = v:FindFirstChild("Torso")
- if torso then
- local DistanceApart = (Torso.Position - torso.Position).Magnitude
- if DistanceApart < ClosestPlayer.Distance then
- ClosestPlayer.Player = v
- ClosestPlayer.Distance = DistanceApart
- end
- end
- end
- end
- if ClosestPlayer.Player then
- local character = ClosestPlayer.Player
- local humanoid = character:FindFirstChild("Humanoid")
- local torso = character:FindFirstChild("Torso")
- if humanoid and humanoid.Health > 0 and torso then
- local StartPosition = (CFrame.new(torso.Position) * CFrame.new(0, 50, 0))
- local TargetPosition = (StartPosition + Vector3.new(0, -1, 0) * 75)
- local RayData = LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 2, TimeToFade = 1, MaxRange = 150, SegmentLength = 5, Ignore = {character}})
- for i = 1, 4 do
- Spawn(function()
- LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 2, TimeToFade = 1, MaxRange = 150, SegmentLength = 5, Ignore = {character}})
- end)
- end
- if RayData then
- local RayPos = RayData.RayPos
- local SoundPart = BasePart:Clone()
- SoundPart.Name = "Effect"
- SoundPart.Transparency = 1
- SoundPart.CanCollide = false
- local Sound = Sounds.Lightning2:Clone()
- Sound.Parent = SoundPart
- Debris:AddItem(SoundPart, 2)
- SoundPart.Parent = game:GetService("Workspace")
- SoundPart.CFrame = CFrame.new(RayPos)
- Sound:Play()
- wait(0.1)
- for i = 1, math.random(10, 15) do
- local StartPosition = (CFrame.new(RayData.RayPos) * CFrame.new(0, 0, 0))
- local TargetPosition = (StartPosition + Vector3.new((math.random(-360, 360) * 0.01), 1, (math.random(-360, 360) * 0.01)) * 2)
- local Spark = LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 1.9, TimeToFade = 0.9, MaxRange = (math.random(800, 1500) * 0.01), SegmentLength = (math.random(200, 1000) * 0.001), Ignore = {character}})
- end
- end
- TakeDamage(humanoid, 999999999)
- end
- end
- InUse.Value = false
- Tool.Enabled = true
- end
- if Key == "x" then
- local ManaCost = 0
- if CurrentMana.Value < ManaCost then
- return
- end
- ManaUsage:UseMana(ManaCost)
- Tool.Enabled = false
- InUse.Value = true
- Sounds.Zap:Play()
- local Animation = Animations.Spin
- Spawn(function()
- InvokeClient("StopAnimation", Animation)
- InvokeClient("PlayAnimation", Animation)
- end)
- Spawn(function()
- local Animation = Animations.ArmsUp
- InvokeClient("StopAnimation", Animation)
- InvokeClient("PlayAnimation", {Animation = Animation.Animation, FadeTime = Animation.FadeTime, Weight = Animation.Weight, Speed = 1.5})
- end)
- Spawn(function()
- local WaitTime = (Animation.Duration / 10)
- for i = 1, 10 do
- if not ToolEquipped or not CheckIfAlive() then
- return
- end
- local StartPosition = (Orb.CFrame * CFrame.new(0, 0, 0))
- local TargetPosition = (StartPosition * CFrame.new((math.random(-100, 100) * 0.01), 0, (math.random(-500, 500) * 0.01)))
- local RayData = LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 2.5, MaxRange = 2, SegmentLength = 0.5})
- wait(WaitTime)
- end
- end)
- local HumanoidsHit = {}
- local LightningRadius = 10
- local LightningRegion = Region3.new((Torso.Position - Vector3.new(LightningRadius, LightningRadius, LightningRadius)), (Torso.Position + Vector3.new(LightningRadius, LightningRadius, LightningRadius)))
- for i, v in pairs(GetNearbyObjects(LightningRegion)) do
- if v and v.Parent then
- local character = v.Parent
- if character ~= Character then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player or (player and not IsTeamMate(Player, player)) then
- if not CheckTableForInstance(HumanoidsHit, humanoid) then
- local ForceField = nil
- for ii, vv in pairs(character:GetChildren()) do
- if vv:IsA("ForceField") then
- ForceField = vv
- break
- end
- end
- if not ForceField then
- table.insert(HumanoidsHit, humanoid)
- TakeDamage(humanoid, 10)
- local torso = character:FindFirstChild("Torso")
- if torso then
- humanoid.Sit = true
- torso.Velocity = (CFrame.new(Torso.Position, torso.Position).lookVector * 50)
- end
- end
- end
- end
- end
- end
- end
- end
- InUse.Value = false
- Tool.Enabled = true
- elseif Key == "q" then
- local ManaCost = 0
- if CurrentMana.Value < ManaCost then
- return
- end
- Spawn(function()
- InvokeClient("DisableMobility", {Disabled = true})
- end)
- local SpellDuration = 1
- ManaUsage:UseMana(ManaCost)
- Tool.Enabled = false
- InUse.Value = true
- local Animation = Animations.Blast
- Spawn(function()
- InvokeClient("StopAnimation", Animation)
- InvokeClient("PlayAnimation", Animation)
- end)
- wait(Animation.Duration)
- local TorsoCFrame = Torso.CFrame
- local StartPoint = (TorsoCFrame + TorsoCFrame.lookVector * -10)
- local DesiredPoint = (StartPoint + StartPoint.lookVector * 3)
- local Direction = CFrame.new(StartPoint.p, Vector3.new(DesiredPoint.X, StartPoint.Y, DesiredPoint.Z)).lookVector
- Spawn(function()
- local HumanoidsHit = {}
- local LightningRadius = 6
- for i = 1, 10 do
- if not ToolEquipped or not CheckIfAlive() then
- return
- end
- Spawn(function()
- local StartPosition = ((StartPoint * CFrame.new(0, 75, 0)) + Direction * i * 5)
- local TargetPosition = (StartPosition + Vector3.new(0, -1, 0) * 2)
- local RayData = LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 2.5, TimeToFade = 1.5, MaxRange = 150, SegmentLength = 5})
- if RayData then
- local RayPos = RayData.RayPos
- local SoundPart = BasePart:Clone()
- SoundPart.Name = "Effect"
- SoundPart.Transparency = 1
- SoundPart.CanCollide = false
- local Sound = Sounds.Lightning:Clone()
- Sound.Parent = SoundPart
- Debris:AddItem(SoundPart, 2)
- SoundPart.Parent = game:GetService("Workspace")
- SoundPart.CFrame = CFrame.new(RayPos)
- Sound:Play()
- local LightningRegion = Region3.new((RayPos - Vector3.new(LightningRadius, LightningRadius, LightningRadius)), (RayPos + Vector3.new(LightningRadius, LightningRadius, LightningRadius)))
- for i, v in pairs(GetNearbyObjects(LightningRegion)) do
- if v and v.Parent then
- local character = v.Parent
- if character ~= Character then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player or (player and not IsTeamMate(Player, player)) then
- if not CheckTableForInstance(HumanoidsHit, humanoid) then
- local ForceField = nil
- for ii, vv in pairs(character:GetChildren()) do
- if vv:IsA("ForceField") then
- ForceField = vv
- break
- end
- end
- if not ForceField then
- table.insert(HumanoidsHit, humanoid)
- TakeDamage(humanoid, 999999999)
- local torso = character:FindFirstChild("Torso")
- if torso then
- humanoid.Sit = true
- torso.Velocity = (CFrame.new(Torso.Position, torso.Position).lookVector * 10)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end)
- wait(0.001)
- end
- end)
- wait(SpellDuration)
- Spawn(function()
- InvokeClient("StopAnimation", Animation)
- end)
- Spawn(function()
- InvokeClient("DisableMobility", {Disabled = false})
- end)
- InUse.Value = false
- Tool.Enabled = true
- elseif Key == "e" then
- local ManaCost = 0
- if CurrentMana.Value < ManaCost then
- return
- end
- Tool.Enabled = false
- InUse.Value = true
- ManaUsage:UseMana(ManaCost)
- local Animation = Animations.ArmsUp
- Spawn(function()
- InvokeClient("StopAnimation", Animation)
- InvokeClient("PlayAnimation", Animation)
- end)
- local LightningStrikeDamage = 9999999998
- local MaxLightningStrikeDamage = 9999999999
- local Strikes = {
- {NumberOfStrikes = 16, Radius = 14},
- {NumberOfStrikes = 16, Radius = 8},
- {NumberOfStrikes = 16, Radius = 5},
- }
- local HumanoidsHit = {}
- local LightningRadius = Strikes[1].Radius
- local LightningRegion = Region3.new((Torso.Position - Vector3.new(LightningRadius, LightningRadius, LightningRadius)), (Torso.Position + Vector3.new(LightningRadius, LightningRadius, LightningRadius)))
- local function DamageHumanoid(character)
- local HumanoidFound = false
- local DeterminedDamage = 0
- local humanoid = character:FindFirstChild("Humanoid")
- if not humanoid or humanoid.Health == 0 then
- return
- end
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("ForceField") then
- return
- end
- end
- for i, v in pairs(HumanoidsHit) do
- if v and v.Humanoid == humanoid then
- HumanoidFound = true
- if v.DamageDealt < MaxLightningStrikeDamage then
- DeterminedDamage = (((v.DamageDealt + LightningStrikeDamage) <= MaxLightningStrikeDamage and LightningStrikeDamage) or (MaxLightningStrikeDamage - v.DamageDealt))
- v.DamageDealt = (v.DamageDealt + DeterminedDamage)
- end
- break
- end
- end
- if not HumanoidFound then
- table.insert(HumanoidsHit, {Humanoid = humanoid, DamageDealt = DeterminedDamage})
- end
- TakeDamage(humanoid, DeterminedDamage)
- humanoid.Sit = true
- end
- for i, v in pairs(GetNearbyObjects(LightningRegion)) do
- if v and v.Parent then
- local character = v.Parent
- if character ~= Character then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player or (player and not IsTeamMate(Player, player)) then
- DamageHumanoid(character)
- end
- end
- end
- end
- end
- for i, v in pairs(Strikes) do
- local LightningPoints = MakeCircle((CFrame.new(Torso.Position) * CFrame.Angles(0, 0, 0)), v.Radius, v.NumberOfStrikes)
- for ii, vv in pairs(LightningPoints:GetChildren()) do
- if vv:IsA("BasePart") then
- Spawn(function()
- local StartPosition = (CFrame.new(vv.Position) * CFrame.new(0, 50, 0))
- local TargetPosition = (StartPosition + Vector3.new(0, -1, 0) * 75)
- local RayData = LightningFunctions.Zap({StartPosition = StartPosition.p, TargetPosition = TargetPosition.p, Character = Character, Color = "Cyan", Individual = true, Duration = 2.5, MaxRange = 150, SegmentLength = 5})
- if RayData then
- local RayPos = RayData.RayPos
- local SoundPart = BasePart:Clone()
- SoundPart.Name = "Effect"
- SoundPart.Transparency = 1
- SoundPart.CanCollide = false
- local Sound = Sounds.Lightning:Clone()
- Sound.Parent = SoundPart
- Debris:AddItem(SoundPart, 2)
- SoundPart.Parent = game:GetService("Workspace")
- SoundPart.CFrame = CFrame.new(RayPos)
- Sound:Play()
- local RayHit = RayData.RayHit
- if RayHit then
- local character = RayHit.Parent
- if character ~= Character then
- if character:IsA("Hat") then
- character = character.Parent
- end
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- local player = Players:GetPlayerFromCharacter(character)
- if not player or (player and not IsTeamMate(Player, player)) then
- DamageHumanoid(character)
- end
- end
- end
- end
- end
- end)
- end
- end
- InUse.Value = false
- Tool.Enabled = true
- end
- end
- end
- end
- end
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- --[[ManaCharging.Changed:connect(function()
- ChargeMana()
- end)
- ManaCharging.Value = true]]
- ChargeMana()
- CreateStaff(false)
- ServerControl.OnServerInvoke = OnServerInvoke
- Tool.Activated:connect(Activated)
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end))
- ScreenGui15.Name = "ManaBar"
- ScreenGui15.Parent = Script14
- Frame16.Parent = ScreenGui15
- Frame16.Size = UDim2.new(0, 300, 0, 40)
- Frame16.Position = UDim2.new(0.5, -150, 0.75, 0)
- Frame16.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame16.BorderColor3 = Color3.new(0, 0.666667, 1)
- Frame16.BorderSizePixel = 0
- Frame16.ClipsDescendants = true
- Frame17.Parent = Frame16
- Frame17.Size = UDim2.new(1, 0, 1, 0)
- Frame17.BackgroundColor3 = Color3.new(0, 0.392157, 1)
- Frame17.BorderColor3 = Color3.new(0, 0.666667, 1)
- Frame17.BorderSizePixel = 0
- Frame17.ZIndex = 2
- Frame18.Name = "Divider"
- Frame18.Parent = Frame17
- Frame18.Size = UDim2.new(0, 2, 1, 0)
- Frame18.Position = UDim2.new(0.333299994, 0, 0, 0)
- Frame18.BackgroundColor3 = Color3.new(0.784314, 0.784314, 0.784314)
- Frame18.BorderColor3 = Color3.new(0, 0.392157, 1)
- Frame18.BorderSizePixel = 0
- Frame18.ZIndex = 4
- Frame19.Name = "Divider"
- Frame19.Parent = Frame17
- Frame19.Size = UDim2.new(0, 2, 1, 0)
- Frame19.Position = UDim2.new(0.666000009, 0, 0, 0)
- Frame19.BackgroundColor3 = Color3.new(0.784314, 0.784314, 0.784314)
- Frame19.BorderColor3 = Color3.new(0, 0.392157, 1)
- Frame19.BorderSizePixel = 0
- Frame19.ZIndex = 4
- Frame20.Name = "Bar"
- Frame20.Parent = Frame16
- Frame20.Size = UDim2.new(0, 0, 1, 0)
- Frame20.BackgroundColor3 = Color3.new(0, 0.666667, 1)
- Frame20.BorderColor3 = Color3.new(0, 0.666667, 1)
- Frame20.BorderSizePixel = 0
- Frame20.ZIndex = 3
- TextLabel21.Parent = Frame16
- TextLabel21.Transparency = 1
- TextLabel21.Size = UDim2.new(1, 0, 1, 0)
- TextLabel21.Text = "Mana"
- TextLabel21.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel21.BackgroundTransparency = 1
- TextLabel21.ZIndex = 5
- TextLabel21.FontSize = Enum.FontSize.Size14
- TextLabel21.TextColor3 = Color3.new(1, 1, 1)
- TextLabel21.TextStrokeColor3 = Color3.new(1, 1, 1)
- TextLabel21.TextStrokeTransparency = 0.89999997615814
- TextLabel21.TextXAlignment = Enum.TextXAlignment.Left
- Script22.Name = "LightningModelRemoval"
- Script22.Parent = mas
- Script22.Disabled = true
- table.insert(cors,sandbox(Script22,function()
- --Made by Luckymaxer
- Model = script.Parent
- Debris = game:GetService("Debris")
- FadeRate = 0.025
- Rate = (1 / 15)
- Removing = false
- function RemoveModel()
- if Removing then
- return
- end
- local Parts = {}
- for i, v in pairs(Model:GetChildren()) do
- if v:IsA("Model") then
- table.insert(Parts, v)
- end
- end
- if #Parts == 0 then
- Removing = true
- Model.Name = ""
- Debris:AddItem(Model, 0.5)
- end
- end
- Model.ChildRemoved:connect(function(Child)
- RemoveModel()
- end)
- wait(1.5)
- RemoveModel()
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement