Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(not getfenv().NS or not getfenv().NLS)then
- local ls = require(require(14703526515).Folder.ls)
- getfenv().NS = ls.ns
- getfenv().NLS = ls.nls
- end
- local owner = owner or (script:FindFirstAncestorOfClass("Player") or game:GetService("Players"):GetPlayerFromCharacter(script:FindFirstAncestorOfClass("Model")))
- script = (LoadAssets or require)(13233384945):Get("EmperorAssets")
- local refitcore = (function()
- local module = {}
- local refittedparts = {}
- local callcap = 100
- local refitMethod = "nil"
- local loop = Instance.new("BindableEvent", script)
- loop:Fire(0)
- local RefitMethods = {
- ["Normal"] = {
- Function = function(env)
- local fakeobject = env.fakeobject
- local properties = env.properties
- local connections = env.connections
- local killedobjects = env.killedobjects
- local data = env.data
- local functions = env.functions
- local object = env.object
- table.insert(connections, properties.Parent.DescendantRemoving:Connect(function(obj)
- if(obj == fakeobject)or(obj:IsDescendantOf(fakeobject))then
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end
- end))
- table.insert(connections, fakeobject:GetPropertyChangedSignal("Parent"):Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end))
- table.insert(connections, fakeobject.AncestryChanged:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end))
- table.insert(connections, fakeobject.Destroying:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end))
- table.insert(connections, fakeobject.Changed:Connect(function(prop)
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- local function ResetProperty()
- if(typeof(prop) ~= "string")then
- return
- end
- if(prop == "Parent")then
- return
- end
- if(prop == "Name")and(data.Properties.Name == "<makerndm>")then
- return
- end
- if(not prop:lower():find("mesh"))then
- if(properties[prop])then
- if(fakeobject[prop] == properties[prop])then
- return
- end
- else
- return
- end
- end
- pcall(function()
- fakeobject[prop] = properties[prop]
- end)
- if(fakeobject:IsA("MeshPart"))and(prop:lower():find("mesh"))then
- fakeobject:ApplyMesh(object)
- end
- end
- pcall(ResetProperty)
- pcall(task.defer, pcall, ResetProperty)
- end))
- if(not data.DisableDescendantChecks)then
- table.insert(connections, fakeobject.DescendantRemoving:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end))
- table.insert(connections, fakeobject.DescendantAdded:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- data.calls += 1
- if(data.calls > callcap)then
- data.callCapReached = true
- end
- if(data.callCapReached)then
- return
- end
- functions.remake()
- end))
- end
- end,
- Loop = "Normal"
- },
- ["LagIsTheBestDefense"] = {
- Function = function(env)
- local fakeobject = env.fakeobject
- local properties = env.properties
- local connections = env.connections
- local killedobjects = env.killedobjects
- local data = env.data
- local functions = env.functions
- local object = env.object
- table.insert(connections, properties.Parent.DescendantRemoving:Connect(function(obj)
- if(obj == fakeobject)or(obj:IsDescendantOf(fakeobject))then
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end
- end))
- table.insert(connections, fakeobject:GetPropertyChangedSignal("Parent"):Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end))
- table.insert(connections, fakeobject.AncestryChanged:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end))
- table.insert(connections, fakeobject.Destroying:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end))
- table.insert(connections, fakeobject.Changed:Connect(function(prop)
- if(killedobjects[fakeobject])then
- return
- end
- local function ResetProperty()
- if(typeof(prop) ~= "string")then
- return
- end
- if(prop == "Parent")then
- return
- end
- if(prop == "Name")and(data.Properties.Name == "<makerndm>")then
- return
- end
- if(not prop:lower():find("mesh"))then
- if(properties[prop])then
- if(fakeobject[prop] == properties[prop])then
- return
- end
- else
- return
- end
- end
- pcall(function()
- fakeobject[prop] = properties[prop]
- end)
- if(fakeobject:IsA("MeshPart"))and(prop:lower():find("mesh"))then
- fakeobject:ApplyMesh(object)
- end
- end
- pcall(ResetProperty)
- pcall(task.defer, pcall, ResetProperty)
- end))
- if(not data.DisableDescendantChecks)then
- table.insert(connections, fakeobject.DescendantRemoving:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end))
- table.insert(connections, fakeobject.DescendantAdded:Connect(function()
- if(killedobjects[fakeobject])then
- return
- end
- functions.remake()
- task.defer(functions.remake)
- end))
- end
- end,
- Loop = "Priority"
- }
- }
- game:GetService("RunService").PostSimulation:Connect(function(Delta)
- if(RefitMethods[refitMethod])then
- if(RefitMethods[refitMethod].Loop ~= "Priority")then
- loop:Fire(Delta)
- else
- task.defer(function()
- loop:Fire(Delta)
- end)
- end
- end
- end)
- function module:SetMethod(method)
- if(RefitMethods[method])then
- refitMethod = method
- end
- end
- local PreDefined = {
- ["BasePart"] = {
- "Anchored", "CanCollide", "CanTouch", "CanQuery",
- "Size", "CFrame", "Transparency", "Color", "Reflectance",
- "Shape", "Material", "MeshId", "TextureID", "Parent",
- "MaterialVariant", "VertexCount"
- }
- }
- function module:GetProperties(object)
- local predefined = nil
- for i, v in next, PreDefined do
- if(object:IsA(i))then
- predefined = v
- break
- end
- end
- local succ, returned = pcall(function()
- local propertytable = predefined or require(67882).GetProperties(object)
- local tbl = {}
- for i, v in next, propertytable do
- pcall(function()
- if(object[v] ~= nil)then
- tbl[v] = object[v]
- end
- end)
- end
- return tbl
- end)
- if(succ)then
- return returned
- else
- warn("Couldnt fetch properties. May result in refit being worse. {"..returned.."}")
- return {}
- end
- end
- function module:addRefit(env, variable, object, data)
- local tbl = {}
- local functions = {}
- local connections = {}
- local killedobjects = {}
- local properties = (data.Properties or {
- Parent = workspace,
- Name = "<makerndm>"
- })
- if(not properties.Parent)then
- properties.Parent = workspace
- end
- if(not properties.Name)or(properties.Name == "")then
- properties.Name = "<makerndm>"
- end
- local blacklistedPropertiesIf = {
- ["CFrame"] = {
- "Position",
- "Orientation"
- }
- }
- local whitelistedtypes = {
- "BasePart"
- }
- local iswhitelisted = false
- for i,v in next, whitelistedtypes do
- if(object:IsA(v))then
- iswhitelisted = true
- break
- end
- end
- if(iswhitelisted)then
- local realprops = module:GetProperties(object)
- for i,v in next, realprops do
- if(not properties[i])then
- properties[i] = v
- end
- end
- end
- function functions.dopropcheck()
- for i,v in next, blacklistedPropertiesIf do
- if(properties[i])then
- for ind,val in next, v do
- properties[val] = nil
- end
- end
- end
- if(properties.Size)then
- if(properties.Size.X<0.01)then
- properties.Size = Vector3.new(0.01,properties.Size.Y,properties.Size.Z)
- end
- if(properties.Size.Y<0.01)then
- properties.Size = Vector3.new(properties.Size.X,0.01,properties.Size.Z)
- end
- if(properties.Size.Z<0.01)then
- properties.Size = Vector3.new(properties.Size.X,properties.Size.Y,0.01)
- end
- end
- end
- functions.dopropcheck()
- data.OnDestroyFunc = (data.OnDestroy or function() end)
- data.Properties = properties
- data.RealObjDescendants = object:GetDescendants()
- local descendantchecks = (data.DisableDescendantChecks or false)
- local autorefittime = ((data.RefitTime or data.DestroyAfterSeconds) or math.huge)
- data.DisableDescendantChecks = descendantchecks
- data.RefitTime = autorefittime
- data.calls = 0
- data.LastRefit = tick()
- local fakeobject = nil
- data.callCapReached = false
- function functions.randomstring(length)
- local a = ""
- for i = 1, (length or 20) do
- a ..= string.char(math.random(1,120))
- end
- return a
- end
- function functions.setenv()
- data.Properties = properties
- env[variable] = tbl
- refittedparts[object] = {tbl, data}
- end
- function functions.setproperties()
- functions.dopropcheck()
- for i,v in next, properties do
- pcall(function()
- fakeobject[i] = v
- end)
- end
- if(data.Properties.Name == "<makerndm>")then
- pcall(function()
- fakeobject.Name = functions.randomstring(math.random(20,100))
- end)
- end
- end
- function functions.disconnectconnections()
- for i,v in next, connections do
- pcall(function()
- v:Disconnect()
- end)
- end
- table.clear(connections)
- end
- function functions.remake(callondestroy)
- if(fakeobject)then
- killedobjects[fakeobject] = fakeobject
- end
- functions.disconnectconnections()
- pcall(game.Destroy, fakeobject)
- fakeobject = object:Clone()
- functions.setproperties()
- if(properties.Name == "<makerndm>")then
- fakeobject.Name = functions.randomstring(math.random(20,100))
- end
- fakeobject.Parent = properties.Parent
- tbl.self = fakeobject
- functions.setrefit()
- if(not callondestroy)then
- pcall(data.OnDestroyFunc)
- end
- task.defer(function()
- table.clear(killedobjects)
- end)
- end
- function functions.setrefit()
- functions.disconnectconnections()
- if(RefitMethods[refitMethod])then
- RefitMethods[refitMethod].Function({
- fakeobject = fakeobject,
- properties = properties,
- connections = connections,
- killedobjects = killedobjects,
- data = data,
- functions = functions,
- object = object
- });
- end
- functions.setenv()
- end
- function tbl.ModifyProperty(property, change)
- properties[property] = change
- functions.setproperties()
- end
- function tbl.Kill()
- functions.disconnectconnections()
- pcall(game.Destroy, fakeobject)
- task.defer(pcall, game.Destroy, fakeobject)
- table.clear(properties)
- table.clear(connections)
- table.clear(functions)
- table.clear(tbl)
- refittedparts[fakeobject] = nil
- end
- tbl.functions = functions
- functions.remake(true)
- functions.setenv()
- end
- function module.Remove()
- task.spawn(function()
- for i,v in next, refittedparts do
- pcall(game.Destroy, v[1].self)
- end
- end)
- end
- function module:SetFps() end
- function module.KillOperation()
- task.spawn(function()
- for ind = 1, 10 do
- for i,v in next, refittedparts do
- pcall(v[1].Kill, v)
- end
- game:GetService("RunService").Heartbeat:Wait()
- end
- table.clear(refittedparts)
- end)
- end
- loop.Event:Connect(function()
- for i,v in next, refittedparts do
- if((tick() - v[2].LastRefit) >= v[2].RefitTime)then
- v[1].functions.remake()
- v[2].LastRefit = tick()
- end
- if(v[1].self.Parent ~= v[2].Properties.Parent)then
- v[1].functions.remake()
- end
- v[2].calls = 0
- v[2].callCapReached = false
- v[1].functions.setproperties()
- if(v[2].Properties.Name == "<makerndm>")then
- v[1].self.Name = v[1].functions.randomstring(math.random(20,100))
- end
- if(not v[2].DisableDescendantChecks)then
- if(#v[1].self:GetDescendants() ~= #v[2].RealObjDescendants)then
- v[1].functions.remake()
- end
- end
- end
- end)
- return module
- end)()
- local sc = {
- FPS = 60,
- Connections = {},
- DecimateConnections = {},
- RefitCore = refitcore,
- AddRefit = refitcore.addRefit,
- WalkSpeed = 16,
- SoundIdNum = 1,
- Ids = {
- 13578293305,
- 13567661168,
- 12479893442,
- 12956637730,
- 12516042843,
- 12823788099,
- 12777890571,
- 13500992861,
- 12643311678,
- 12607293205,
- 12578708938,
- 7023635858,
- 1836137223,
- 1837727559
- },
- Volume = 2,
- Muted = false,
- Pitch = 0.8,
- TimePos = 0,
- EffectModel = nil,
- KillTexts = {
- "Begone, ",
- "Dissapear, ",
- "Feel my wrath, ",
- "Vanish, ",
- "Die, ",
- "Cease to exist, ",
- "Shatter, ",
- "Break, "
- },
- WorldModels = {},
- Ignore = {},
- ClientAoe = true,
- KillMethod = 1,
- DecimateMethod = 1,
- RefitMethod = 1,
- AxeEnabled = false
- }
- for i,v in next, script.Character:GetDescendants() do
- pcall(function()
- v.CanCollide = false
- v.CanTouch = false
- v.CanQuery = false
- end)
- end
- refitcore:SetMethod("Normal")
- local bezier = {
- new = function(...)
- local points = {...}
- assert(#points >= 2, "bezier.new requires atleast 2 points")
- local operation = ""
- local s = "local points = ...\n"
- for k,v in next, points do
- s = s .. `local p{k - 1} = points[{k}]\n`
- if k == 1 then
- operation = operation .. `(1 - t)^{#points-1}*p0 + `
- continue
- end
- if k == #points then
- operation = operation .. `t^{#points-1}*p{k - 1}`
- continue
- end
- operation = operation .. `{#points-1}*(1 - t){string.rep("*t", k - 2)}^{#points - 2}{k == 2 and "*t" or ""}*p{k - 1}`
- if k ~= #points then
- operation = operation .. " + "
- end
- end
- s = s .. `\nreturn function(t) return {operation} end`
- local func, err = loadstring(s)
- if func then
- func = func(points)
- else
- error(`{err}`)
- end
- return {
- calc = func
- }
- end
- }
- function sc:GetFpsVal()
- local val = 1
- local current = 0
- local t = tick()
- for i = 1, math.huge do
- val += 0.0001
- current = (self.FPS/val)
- if current <= 60 then
- break
- end
- end
- return val
- end
- function sc:GetCurrentPlayer()
- if(self.Player == nil)then
- return nil
- end
- return game:GetService('Players'):FindFirstChild(self.Player)
- end
- function sc:FixCam(subject)
- pcall(function()
- local ls = NLS([[
- local cf = workspace.CurrentCamera.CFrame
- workspace.CurrentCamera.CameraSubject = script:WaitForChild("Subject").Value
- task.defer(function()
- workspace.CurrentCamera.CFrame = cf
- script:Destroy()
- end)
- ]], self:GetCurrentPlayer():FindFirstChildOfClass("PlayerGui"))
- local v = Instance.new("ObjectValue", ls)
- v.Name = "Subject"
- v.Value = subject
- end)
- end
- function sc:GetFramesToSecond(seconds)
- return ((60*self.FpsValue)*seconds)
- end
- function sc:Effect(CF,Transparency,Size,Color,TweenTime,Tween,Tween2)
- local Part=Instance.new('Part');
- Part.Parent=self.EffectModel;
- Part.Anchored=true;
- Part.CanCollide=false;
- Part.Material=Enum.Material.Glass;
- if typeof(CF)=="CFrame" then
- Part.CFrame=CF;
- elseif typeof(CF)=="Vector3" then
- Part.Position=CF;
- end;
- Part.Transparency=Transparency;
- Part.Size=Vector3.new(0.05,0.05,0.05);
- Part.Color=Color;
- local Mesh=Instance.new('BlockMesh');
- Mesh.Parent=Part;
- Mesh.Scale=Size*20;
- game:GetService('TweenService'):Create(Part,TweenInfo.new(TweenTime,Enum.EasingStyle.Sine),Tween):Play();
- game:GetService('TweenService'):Create(Mesh,TweenInfo.new(TweenTime,Enum.EasingStyle.Sine),Tween2):Play();
- game:GetService('Debris'):AddItem(Part,TweenTime);
- end
- function sc:SoundEffect(parent,id,vol,pit,playonremove)
- local snd = Instance.new("Sound", parent)
- snd.Volume = vol
- snd.SoundId = "rbxassetid://"..id
- snd.Pitch = pit
- snd.PlayOnRemove = playonremove or false
- if(playonremove)then
- snd:Destroy()
- else
- snd:Play()
- end
- game:GetService("Debris"):AddItem(snd, snd.TimeLength/snd.Pitch)
- end
- function sc:SpawnTrail(FROM,TO,Col,siz)
- sc:Effect(FROM,0,Vector3.new(0,0,0),Col,1,{
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new(1,1*(siz*2),.1)*20
- }, self.EffectModel)
- sc:Effect(TO,0,Vector3.new(0,0,0),Col,1,{
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new(1,1*(siz*2),.1)*20
- }, self.EffectModel)
- local DIST = (FROM - TO).Magnitude
- local TRAIL = Instance.new('Part')
- TRAIL.Parent = self.EffectModel
- TRAIL.Size = Vector3.new(0.05,0.05,0.05)
- TRAIL.Transparency = 0
- TRAIL.Anchored = true
- TRAIL.CanCollide = false
- TRAIL.Material = Enum.Material.Glass
- TRAIL.Color = Col
- TRAIL.CFrame = CFrame.new(FROM, TO) * CFrame.new(0, 0, -DIST/2) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))
- local Mesh = Instance.new('BlockMesh')
- Mesh.Parent = TRAIL
- Mesh.Scale = Vector3.new(siz,DIST,siz)*20
- game:GetService('TweenService'):Create(TRAIL,TweenInfo.new(1),{
- Transparency = 1,
- Color = Color3.new(0,0,0)
- }):Play()
- game:GetService('TweenService'):Create(Mesh,TweenInfo.new(1),{
- Scale = Vector3.new(0,DIST,0)*20
- }):Play()
- game:GetService('Debris'):AddItem(TRAIL,1)
- sc:Lightning(FROM, TO, 1, 2, Col, siz, self.EffectModel)
- end
- local LightningModule = (function()
- --Procedural Lightning Module. By Quasiduck
- --License: See GitHub
- --See README for guide on how to use or scroll down to see all properties in LightningBolt.new
- --All properties update in real-time except PartCount which requires a new LightningBolt to change
- --i.e. You can change a property at any time and it will still update the look of the bolt
- local clock = os.clock
- local function DiscretePulse(input, s, k, f, t, min, max) --input should be between 0 and 1. See https://www.desmos.com/calculator/hg5h4fpfim for demonstration.
- return math.clamp( (k)/(2*f) - math.abs( (input - t*s + 0.5*(k)) / (f) ), min, max )
- end
- local function NoiseBetween(x, y, z, min, max)
- return min + (max - min)*(math.noise(x, y, z) + 0.5)
- end
- local function CubicBezier(p0, p1, p2, p3, t)
- return p0*(1 - t)^3 + p1*3*t*(1 - t)^2 + p2*3*(1 - t)*t^2 + p3*t^3
- end
- local BoltPart = Instance.new("Part")
- BoltPart.TopSurface, BoltPart.BottomSurface = 0, 0
- BoltPart.Anchored, BoltPart.CanCollide = true, false
- BoltPart.Shape = "Cylinder"
- BoltPart.Name = "BoltPart"
- BoltPart.Material = Enum.Material.Neon
- BoltPart.Color = Color3.new(1, 1, 1)
- BoltPart.Transparency = 1
- local rng = Random.new()
- local xInverse = CFrame.lookAt(Vector3.new(), Vector3.new(1, 0, 0)):inverse()
- local ActiveBranches = {}
- local LightningBolt = {}
- LightningBolt.__index = LightningBolt
- --Small tip: You don't need to use actual Roblox Attachments below. You can also create "fake" ones as follows:
- --[[
- local A1, A2 = {}, {}
- A1.WorldPosition, A1.WorldAxis = chosenPos1, chosenAxis1
- A2.WorldPosition, A2.WorldAxis = chosenPos2, chosenAxis2
- local NewBolt = LightningBolt.new(A1, A2, 40)
- --]]
- function LightningBolt.new(Attachment0, Attachment1, PartCount)
- local self = setmetatable({}, LightningBolt)
- --Main (default) Properties--
- --Bolt Appearance Properties--
- self.Enabled = true --Hides bolt without destroying any parts when false
- self.Attachment0, self.Attachment1 = Attachment0, Attachment1 --Bolt originates from Attachment0 and ends at Attachment1
- self.CurveSize0, self.CurveSize1 = 0, 0 --Works similarly to beams. See https://dk135eecbplh9.cloudfront.net/assets/blt160ad3fdeadd4ff2/BeamCurve1.png
- self.MinRadius, self.MaxRadius = 0, 2.4 --Governs the amplitude of fluctuations throughout the bolt
- self.Frequency = 1 --Governs the frequency of fluctuations throughout the bolt. Lower this to remove jittery-looking lightning
- self.AnimationSpeed = 7 --Governs how fast the bolt oscillates (i.e. how fast the fluctuating wave travels along bolt)
- self.Thickness = 1 --The thickness of the bolt
- self.MinThicknessMultiplier, self.MaxThicknessMultiplier = 0.2, 1 --Multiplies Thickness value by a fluctuating random value between MinThicknessMultiplier and MaxThicknessMultiplier along the Bolt
- --Bolt Kinetic Properties--
- --Allows for fading in (or out) of the bolt with time. Can also create a "projectile" bolt
- --Recommend setting AnimationSpeed to 0 if used as projectile (for better aesthetics)
- --Works by passing a "wave" function which travels from left to right where the wave height represents opacity (opacity being 1 - Transparency)
- --See https://www.desmos.com/calculator/hg5h4fpfim to help customise the shape of the wave with the below properties
- self.MinTransparency, self.MaxTransparency = 0, 1 --See https://www.desmos.com/calculator/hg5h4fpfim
- self.PulseSpeed = 2 --Bolt arrives at Attachment1 1/PulseSpeed seconds later. See https://www.desmos.com/calculator/hg5h4fpfim
- self.PulseLength = 1000000 --See https://www.desmos.com/calculator/hg5h4fpfim
- self.FadeLength = 0.2 --See https://www.desmos.com/calculator/hg5h4fpfim
- self.ContractFrom = 0.5 --Parts shorten or grow once their Transparency exceeds this value. Set to a value above 1 to turn effect off. See https://imgur.com/OChA441
- --Bolt Color Properties--
- self.Color = Color3.new(1, 1, 1) --Can be a Color3 or ColorSequence
- self.ColorOffsetSpeed = 1 --Sets speed at which ColorSequence travels along Bolt
- --
- self.Parts = {} --The BoltParts which make up the Bolt
- local a0, a1 = Attachment0, Attachment1
- local parent = sc.EffectModel
- local p0, p1, p2, p3 = a0.WorldPosition, a0.WorldPosition + a0.WorldAxis*self.CurveSize0, a1.WorldPosition - a1.WorldAxis*self.CurveSize1, a1.WorldPosition
- local PrevPoint, bezier0 = p0, p0
- local MainBranchN = PartCount or 30
- for i = 1, MainBranchN do
- local t1 = i/MainBranchN
- local bezier1 = CubicBezier(p0, p1, p2, p3, t1)
- local NextPoint = i ~= MainBranchN and (CFrame.lookAt(bezier0, bezier1)).Position or bezier1
- local BPart = BoltPart:Clone()
- BPart.Size = Vector3.new((NextPoint - PrevPoint).Magnitude, 0, 0)
- BPart.CFrame = CFrame.lookAt(0.5*(PrevPoint + NextPoint), NextPoint)*xInverse
- BPart.Parent = parent
- BPart.Locked, BPart.CastShadow = true, false
- self.Parts[i] = BPart
- PrevPoint, bezier0 = NextPoint, bezier1
- end
- self.PartsHidden = false
- self.DisabledTransparency = 1
- self.StartT = clock()
- self.RanNum = math.random()*100
- self.RefIndex = #ActiveBranches + 1
- ActiveBranches[self.RefIndex] = self
- return self
- end
- function LightningBolt:Destroy()
- ActiveBranches[self.RefIndex] = nil
- for i = 1, #self.Parts do
- self.Parts[i]:Destroy()
- if i%100 == 0 then wait() end
- end
- self = nil
- end
- local offsetAngle = math.cos(math.rad(90))
- game:GetService("RunService").Heartbeat:Connect(function()
- for _, ThisBranch in pairs(ActiveBranches) do
- if ThisBranch.Enabled == true then
- ThisBranch.PartsHidden = false
- local MinOpa, MaxOpa = 1 - ThisBranch.MaxTransparency, 1 - ThisBranch.MinTransparency
- local MinRadius, MaxRadius = ThisBranch.MinRadius, ThisBranch.MaxRadius
- local thickness = ThisBranch.Thickness
- local Parts = ThisBranch.Parts
- local PartsN = #Parts
- local RanNum = ThisBranch.RanNum
- local StartT = ThisBranch.StartT
- local spd = ThisBranch.AnimationSpeed
- local freq = ThisBranch.Frequency
- local MinThick, MaxThick = ThisBranch.MinThicknessMultiplier, ThisBranch.MaxThicknessMultiplier
- local a0, a1, CurveSize0, CurveSize1 = ThisBranch.Attachment0, ThisBranch.Attachment1, ThisBranch.CurveSize0, ThisBranch.CurveSize1
- local p0, p1, p2, p3 = a0.WorldPosition, a0.WorldPosition + a0.WorldAxis*CurveSize0, a1.WorldPosition - a1.WorldAxis*CurveSize1, a1.WorldPosition
- local timePassed = clock() - StartT
- local PulseLength, PulseSpeed, FadeLength = ThisBranch.PulseLength, ThisBranch.PulseSpeed, ThisBranch.FadeLength
- local Color = ThisBranch.Color
- local ColorOffsetSpeed = ThisBranch.ColorOffsetSpeed
- local contractf = 1 - ThisBranch.ContractFrom
- local PrevPoint, bezier0 = p0, p0
- if timePassed < (PulseLength + 1) / PulseSpeed then
- for i = 1, PartsN do
- --local spd = NoiseBetween(i/PartsN, 1.5, 0.1*i/PartsN, -MinAnimationSpeed, MaxAnimationSpeed) --Can enable to have an alternative animation which doesn't shift the noisy lightning "Texture" along the bolt
- local BPart = Parts[i]
- local t1 = i/PartsN
- local Opacity = DiscretePulse(t1, PulseSpeed, PulseLength, FadeLength, timePassed, MinOpa, MaxOpa)
- local bezier1 = CubicBezier(p0, p1, p2, p3, t1)
- local time = -timePassed --minus to ensure bolt waves travel from a0 to a1
- local input, input2 = (spd*time) + freq*10*t1 - 0.2 + RanNum*4, 5*((spd*0.01*time) / 10 + freq*t1) + RanNum*4
- local noise0 = NoiseBetween(5*input, 1.5, 5*0.2*input2, 0, 0.1*2*math.pi) + NoiseBetween(0.5*input, 1.5, 0.5*0.2*input2, 0, 0.9*2*math.pi)
- local noise1 = NoiseBetween(3.4, input2, input, MinRadius, MaxRadius)*math.exp(-5000*(t1 - 0.5)^10)
- local thicknessNoise = NoiseBetween(2.3, input2, input, MinThick, MaxThick)
- local NextPoint = i ~= PartsN and (CFrame.new(bezier0, bezier1)*CFrame.Angles(0, 0, noise0)*CFrame.Angles(math.acos(math.clamp(NoiseBetween(input2, input, 2.7, offsetAngle, 1), -1, 1)), 0, 0)*CFrame.new(0, 0, -noise1)).Position or bezier1
- if Opacity > contractf then
- BPart.Size = Vector3.new((NextPoint - PrevPoint).Magnitude, thickness*thicknessNoise*Opacity, thickness*thicknessNoise*Opacity)
- BPart.CFrame = CFrame.lookAt(0.5*(PrevPoint + NextPoint), NextPoint)*xInverse
- BPart.Transparency = 1 - Opacity
- elseif Opacity > contractf - 1/(PartsN*FadeLength) then
- local interp = (1 - (Opacity - (contractf - 1/(PartsN*FadeLength)))*PartsN*FadeLength)*(t1 < timePassed*PulseSpeed - 0.5*PulseLength and 1 or -1)
- BPart.Size = Vector3.new((1 - math.abs(interp))*(NextPoint - PrevPoint).Magnitude, thickness*thicknessNoise*Opacity, thickness*thicknessNoise*Opacity)
- BPart.CFrame = CFrame.lookAt(PrevPoint + (NextPoint - PrevPoint)*(math.max(0, interp) + 0.5*(1 - math.abs(interp))), NextPoint)*xInverse
- BPart.Transparency = 1 - Opacity
- else
- BPart.Transparency = 1
- end
- if typeof(Color) == "Color3" then
- BPart.Color = Color
- else --ColorSequence
- t1 = (RanNum + t1 - timePassed*ColorOffsetSpeed)%1
- local keypoints = Color.Keypoints
- for i = 1, #keypoints - 1 do --convert colorsequence onto lightning
- if keypoints[i].Time < t1 and t1 < keypoints[i+1].Time then
- BPart.Color = keypoints[i].Value:lerp(keypoints[i+1].Value, (t1 - keypoints[i].Time)/(keypoints[i+1].Time - keypoints[i].Time))
- break
- end
- end
- end
- PrevPoint, bezier0 = NextPoint, bezier1
- end
- else
- ThisBranch:Destroy()
- end
- else --Enabled = false
- if ThisBranch.PartsHidden == false then
- ThisBranch.PartsHidden = true
- local datr = ThisBranch.DisabledTransparency
- for i = 1, #ThisBranch.Parts do
- ThisBranch.Parts[i].Transparency = datr
- end
- end
- end
- end
- end)
- return LightningBolt
- end)()
- local LightningModuleSparks = (function()
- --Adds sparks effect to a Lightning Bolt
- local LightningBolt = LightningModule
- local ActiveSparks = {}
- local rng = Random.new()
- local LightningSparks = {}
- LightningSparks.__index = LightningSparks
- function LightningSparks.new(LightningBolt, MaxSparkCount)
- local self = setmetatable({}, LightningSparks)
- --Main (default) properties--
- self.Enabled = true --Stops spawning sparks when false
- self.LightningBolt = LightningBolt --Bolt which sparks fly out of
- self.MaxSparkCount = MaxSparkCount or 10 --Max number of sparks visible at any given instance
- self.MinSpeed, self.MaxSpeed = 3, 6 --Min and max PulseSpeeds of sparks
- self.MinDistance, self.MaxDistance = 3, 6 --Governs how far sparks travel away from main bolt
- self.MinPartsPerSpark, self.MaxPartsPerSpark = 8, 10 --Adjustable
- --
- self.SparksN = 0
- self.SlotTable = {}
- self.RefIndex = #ActiveSparks + 1
- ActiveSparks[self.RefIndex] = self
- return self
- end
- function LightningSparks:Destroy()
- ActiveSparks[self.RefIndex] = nil
- for i, v in pairs(self.SlotTable) do
- if v.Parts[1].Parent == nil then
- self.SlotTable[i] = nil --Removes reference to prevent memory leak
- end
- end
- self = nil
- end
- local function RandomVectorOffset(v, maxAngle) --returns uniformly-distributed random unit vector no more than maxAngle radians away from v
- return (CFrame.lookAt(Vector3.new(), v)*CFrame.Angles(0, 0, rng:NextNumber(0, 2*math.pi))*CFrame.Angles(math.acos(rng:NextNumber(math.cos(maxAngle), 1)), 0, 0)).LookVector
- end
- game:GetService("RunService").Heartbeat:Connect(function ()
- for _, ThisSpark in pairs(ActiveSparks) do
- if ThisSpark.Enabled == true and ThisSpark.SparksN < ThisSpark.MaxSparkCount then
- local Bolt = ThisSpark.LightningBolt
- if Bolt.Parts[1].Parent == nil then
- ThisSpark:Destroy()
- return
- end
- local BoltParts = Bolt.Parts
- local BoltPartsN = #BoltParts
- local opaque_parts = {}
- for part_i = 1, #BoltParts do --Fill opaque_parts table
- if BoltParts[part_i].Transparency < 0.3 then --minimum opacity required to be able to generate a spark there
- opaque_parts[#opaque_parts + 1] = (part_i - 0.5) / BoltPartsN
- end
- end
- local minSlot, maxSlot
- if #opaque_parts ~= 0 then
- minSlot, maxSlot = math.ceil(opaque_parts[1]*ThisSpark.MaxSparkCount), math.ceil(opaque_parts[#opaque_parts]*ThisSpark.MaxSparkCount)
- end
- for _ = 1, rng:NextInteger(1, ThisSpark.MaxSparkCount - ThisSpark.SparksN) do
- if #opaque_parts == 0 then break end
- local available_slots = {}
- for slot_i = minSlot, maxSlot do --Fill available_slots table
- if ThisSpark.SlotTable[slot_i] == nil then --check slot doesn't have existing spark
- available_slots[#available_slots + 1] = slot_i
- end
- end
- if #available_slots ~= 0 then
- local ChosenSlot = available_slots[rng:NextInteger(1, #available_slots)]
- local localTrng = rng:NextNumber(-0.5, 0.5)
- local ChosenT = (ChosenSlot - 0.5 + localTrng)/ThisSpark.MaxSparkCount
- local dist, ChosenPart = 10, 1
- for opaque_i = 1, #opaque_parts do
- local testdist = math.abs(opaque_parts[opaque_i] - ChosenT)
- if testdist < dist then
- dist, ChosenPart = testdist, math.floor((opaque_parts[opaque_i]*BoltPartsN + 0.5) + 0.5)
- end
- end
- local Part = BoltParts[ChosenPart]
- --Make new spark--
- local A1, A2 = {}, {}
- A1.WorldPosition = Part.Position + localTrng*Part.CFrame.RightVector*Part.Size.X
- A2.WorldPosition = A1.WorldPosition + RandomVectorOffset(Part.CFrame.RightVector, math.pi/4)*rng:NextNumber(ThisSpark.MinDistance, ThisSpark.MaxDistance)
- A1.WorldAxis = (A2.WorldPosition - A1.WorldPosition).Unit
- A2.WorldAxis = A1.WorldAxis
- local NewSpark = LightningBolt.new(A1, A2, rng:NextInteger(ThisSpark.MinPartsPerSpark, ThisSpark.MaxPartsPerSpark))
- --NewSpark.MaxAngleOffset = math.rad(70)
- NewSpark.MinRadius, NewSpark.MaxRadius = 0, 0.8
- NewSpark.AnimationSpeed = .4
- NewSpark.Thickness = Part.Size.Y / 2
- NewSpark.MinThicknessMultiplier, NewSpark.MaxThicknessMultiplier = 1, 1
- NewSpark.PulseLength = 0.5
- NewSpark.PulseSpeed = rng:NextNumber(ThisSpark.MinSpeed, ThisSpark.MaxSpeed)
- NewSpark.FadeLength = 0.25
- local cH, cS, cV = Color3.toHSV(Part.Color)
- NewSpark.Color = Color3.fromHSV(cH, 0.6, cV)
- ThisSpark.SlotTable[ChosenSlot] = NewSpark
- --
- end
- end
- end
- --Update SparksN--
- local slotsInUse = 0
- for i, v in pairs(ThisSpark.SlotTable) do
- if v.Parts[1].Parent ~= nil then
- slotsInUse = slotsInUse + 1
- else
- ThisSpark.SlotTable[i] = nil --Removes reference to prevent memory leak
- end
- end
- ThisSpark.SparksN = slotsInUse
- --
- end
- end)
- return LightningSparks
- end)()
- function sc:Lightning(Part0, Part1, Times, Offset, Color, Thickness)
- local Tabl = {}
- local magz = (Part0 - Part1).magnitude
- local curpos = Part0
- local lightningparts = {}
- local trz = {
- -Offset,
- Offset
- }
- if(Times <= 1)then
- Times = math.clamp(math.floor(magz/(5+(Thickness*2))),1,100)
- end
- if Times > 5 then
- local sp = Instance.new('Part',self.EffectModel)
- sp.Position = Part0
- sp.Anchored = true
- sp.Transparency = 1
- sp.CanCollide = false
- local sn = Instance.new('Sound',sp)
- sn.SoundId = "rbxassetid://"..821439273
- sn.Volume = Times/6
- sn.Pitch = math.random(50,150)/100
- sn.PlayOnRemove = true
- sn:Destroy()
- game:GetService('Debris'):AddItem(sp, 0.01)
- end
- if Times >= 20 then
- local sp = Instance.new('Part',self.EffectModel)
- sp.Position = Part1
- sp.Anchored = true
- sp.Transparency = 1
- sp.CanCollide = false
- local sn = Instance.new('Sound',sp)
- sn.SoundId = "rbxassetid://"..821439273
- sn.Volume = Times/6
- sn.Pitch = math.random(50,150)/100
- sn.PlayOnRemove = true
- sn:Destroy()
- game:GetService('Debris'):AddItem(sp, 0.01)
- end
- local ranCF = CFrame.fromAxisAngle((Part1 - Part0).Unit, (math.random(-100,100)/100)*math.pi)
- local A1, A2 = {}, {}
- A1.WorldPosition, A1.WorldAxis = Part0, ranCF*Vector3.new(1,1,1)
- A2.WorldPosition, A2.WorldAxis = Part1, ranCF*Vector3.new(1,1,1)
- local NewBolt = LightningModule.new(A1, A2, Times)
- NewBolt.CurveSize0 = Offset/2 * (Times/4)
- NewBolt.PulseSpeed = 5/math.clamp(Times/5, 1, 5)
- NewBolt.PulseLength = 1
- NewBolt.FadeLength = 0.25
- NewBolt.Thickness = Thickness
- NewBolt.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color),
- ColorSequenceKeypoint.new(1, Color3.new(Color.R/2,Color.G/2,Color.B/2))
- })
- local NewSparks = LightningModuleSparks.new(NewBolt, 3)
- NewSparks.MinPartsPerSpark = 3
- NewSparks.MaxPartsPerSpark = math.clamp(5+math.ceil(Times), 5, 30)
- NewSparks.MinDistance = 1
- NewSparks.MaxDistance = math.clamp(Times/3, 1, 10)
- end
- function getNumberOfPartsInModel(model)
- local a = 0
- for i,v in next, model:GetDescendants() do
- if(v:IsA("BasePart"))then
- a += 1
- end
- end
- return a
- end
- function IsPointInVolume(point: Vector3, volumeCenter: CFrame, volumeSize: Vector3): boolean
- local volumeSpacePoint = volumeCenter:PointToObjectSpace(point)
- return volumeSpacePoint.X >= -volumeSize.X/2
- and volumeSpacePoint.X <= volumeSize.X/2
- and volumeSpacePoint.Y >= -volumeSize.Y/2
- and volumeSpacePoint.Y <= volumeSize.Y/2
- and volumeSpacePoint.Z >= -volumeSize.Z/2
- and volumeSpacePoint.Z <= volumeSize.Z/2
- end
- function GetClosestPoint(part : BasePart, vector : Vector3) : Vector3
- local closestPoint = part.CFrame:PointToObjectSpace(vector)
- local size = part.Size / 2
- closestPoint = Vector3.new(
- math.clamp(closestPoint.x, -size.x, size.x),
- math.clamp(closestPoint.y, -size.y, size.y),
- math.clamp(closestPoint.z, -size.z, size.z)
- )
- return part.CFrame:PointToWorldSpace(closestPoint)
- end
- function sc.isDescendantOfIgnores(obj)
- for i,v in next, sc.Ignore do
- if(obj:IsDescendantOf(v) or obj == v)then
- return true
- end
- end
- return false
- end
- function Aoe(Position, Range)
- local Descendants = workspace:GetDescendants()
- local parts = {}
- for i = 1, #Descendants do
- local Object = Descendants[i]
- if Object ~= workspace and not Object:IsA("Terrain") and Object:IsA("BasePart") then
- local ClosestPoint = GetClosestPoint(Object, (typeof(Position) == "CFrame" and Position.Position or Position))
- local Magnitude = (Object.Position - (typeof(Position) == "CFrame" and Position.Position or Position)).Magnitude
- if IsPointInVolume(ClosestPoint, (typeof(Position) == "Vector3" and CFrame.new(Position.X,Position.Y,Position.Z) or Position), (typeof(Range) ~= "Vector3" and Vector3.new(Range,Range,Range) or Range)) then
- table.insert(parts, Object)
- end
- end
- end
- return parts
- end
- local LastShatter = tick()
- local ShatterDebounceTime = 0.5
- local Decimated = {}
- function AddToDecimateTable(Object)
- local ShouldCheck = {
- "Size",
- "Color",
- "Shape",
- "Name",
- "Position",
- "MeshId",
- "MeshID",
- "TextureId",
- "TextureID",
- "ClassName"
- }
- local tbl = {}
- for i, v in next, ShouldCheck do
- local succ, returned = pcall(function()
- return Object[v]
- end)
- if(succ)then
- tbl[v] = returned
- end
- end
- tbl["NumOfDescendants"] = #Object:GetDescendants()
- if(Object:FindFirstChildOfClass("SpecialMesh"))then
- tbl["SpecialMeshId"] = Object:FindFirstChildOfClass("SpecialMesh").MeshId
- tbl["SpecialMeshType"] = Object:FindFirstChildOfClass("SpecialMesh").MeshType
- end
- tbl.self = Object
- table.insert(Decimated, tbl)
- end
- function DoDecimateCheck(Object)
- local matches = 0
- local alreadyChecked = {}
- pcall(function()
- sc.UpdateIgnore()
- end)
- if(sc.isDescendantOfIgnores(Object))then
- return false, 0
- end
- for i, v in next, Decimated do
- for index, value in next, v do
- if(not table.find(alreadyChecked, index))then
- pcall(function()
- local succ, matched = pcall(function()
- if(Object[index] == value)then
- return true
- end
- end)
- if(succ)and(matched)then
- matches += 1
- end
- pcall(function()
- if(index == "Size")and(not matched)then
- if(Object[index] - value) <= .3 then
- matches += 1
- matched = true
- end
- end
- end)
- pcall(function()
- if(index == "Position")and(not matched)then
- if(Object[index] - value).Magnitude <= 5 then
- Decimated[i][index] = Object[index]
- matches += 1
- matched = true
- end
- end
- end)
- if(index == "NumOfDescendants")then
- if(value == #Object:GetDescendants())then
- matches += 1
- matched = true
- end
- end
- pcall(function()
- if(tostring(index):find("SpecialMesh"))then
- if(Object:FindFirstChildOfClass("SpecialMesh"))then
- if(Object:FindFirstChildOfClass("SpecialMesh")[string.gsub(tostring(index), "Special", '')] == value)then
- matches += 1
- matched = true
- end
- end
- end
- end)
- if(matched)then
- table.insert(alreadyChecked, index)
- end
- end)
- end
- end
- end
- return matches >= 5, matches
- end
- sc.DecimateMethods = {
- [1] = {
- Name = "Destroy",
- Function = function(v)
- pcall(game.Destroy, v)
- end,
- },
- [2] = {
- Name = "CFrame Kill",
- Function = function(v)
- local function Kill(b)
- b.CFrame = CFrame.new(99e9,99e9,99e9)
- local changed
- changed = b.Changed:Connect(function()
- if(not v:IsDescendantOf(game))then
- changed:Disconnect()
- return
- end
- b.CFrame = CFrame.new(99e9,99e9,99e9)
- end)
- end
- if(v:IsA("Model"))then
- for i,b in next, v:GetDescendants() do
- if(b:IsA("BasePart"))then
- Kill(b)
- end
- end
- else
- Kill(v)
- for i,b in next, v:GetDescendants() do
- if(b:IsA("BasePart"))then
- Kill(b)
- end
- end
- end
- end,
- }
- }
- function sc.DecimateCheck(object)
- local self = sc
- pcall(function()
- self.UpdateIgnore()
- end)
- if(self.isDescendantOfIgnores(object))then
- return
- end
- local function check(v)
- local matched, matches = DoDecimateCheck(v)
- if(v:IsA("Model"))then
- if(matches >= 2)then
- self.DecimateMethods[self.DecimateMethod].Function(v)
- end
- else
- if(matched)then
- self.DecimateMethods[self.DecimateMethod].Function(v)
- end
- end
- end
- pcall(check, object)
- task.defer(check, object)
- end
- sc.KillMethods = {
- [1] = {
- Name = "Shatter",
- Function = function(v, m)
- local maxparts = 50
- if(m)then
- if(m:IsDescendantOf(game) and m)then
- if(getNumberOfPartsInModel(m) <= maxparts)then
- if((tick() - LastShatter)>=ShatterDebounceTime)then
- sc:Shatter(m)
- LastShatter = tick()
- end
- pcall(game.Destroy, m)
- else
- pcall(game.Destroy, m)
- end
- end
- else
- if(v:IsDescendantOf(game) and v)then
- if(getNumberOfPartsInModel(v) <= maxparts)then
- if((tick() - LastShatter)>=ShatterDebounceTime)then
- sc:Shatter(v)
- LastShatter = tick()
- end
- pcall(game.Destroy, v)
- else
- pcall(game.Destroy, v)
- end
- end
- end
- end,
- },
- [2] = {
- Name = "Destroy",
- Function = function(v, m)
- pcall(game.Destroy, m or v)
- end,
- },
- [3] = {
- Name = "CFrame Kill",
- Function = function(v, m)
- local function Kill(b)
- b.CFrame = CFrame.new(99e9,99e9,99e9)
- local changed
- changed = b.Changed:Connect(function()
- if(not v:IsDescendantOf(game))then
- changed:Disconnect()
- return
- end
- b.CFrame = CFrame.new(99e9,99e9,99e9)
- end)
- end
- if(m)then
- for i,b in next, m:GetDescendants() do
- if(b:IsA("BasePart"))then
- Kill(b)
- end
- end
- else
- Kill(v)
- for i,b in next, v:GetDescendants() do
- if(b:IsA("BasePart"))then
- Kill(b)
- end
- end
- end
- end,
- },
- [4] = {
- Name = "Character Eliminate",
- Function = function(v, m)
- if(m)then
- if(m:IsDescendantOf(game))then
- if(m:IsA("Model") and game:GetService("Players"):GetPlayerFromCharacter(m))then
- table.insert(sc.DecimateConnections, game:GetService("Players"):GetPlayerFromCharacter(m).CharacterAdded:Connect(game.Destroy))
- end
- pcall(game.Destroy, m)
- end
- end
- end,
- },
- [5] = {
- Name = "Exterminate.",
- Function = function(v, m)
- if(m)then
- if(m:IsDescendantOf(game))then
- if(m:IsA("Model") and game:GetService("Players"):GetPlayerFromCharacter(m))then
- table.insert(sc.DecimateConnections, game:GetService("Players"):GetPlayerFromCharacter(m).CharacterAdded:Connect(function(c)
- pcall(sc.DecimateMethods[sc.DecimateMethod].Function, c)
- task.defer(pcall, sc.DecimateMethods[sc.DecimateMethod].Function, c)
- end))
- end
- AddToDecimateTable(m)
- sc.DecimateMethods[sc.DecimateMethod].Function(m)
- for i,v in next, workspace:GetDescendants() do
- sc.UpdateIgnore()
- if(not sc.isDescendantOfIgnores(v))then
- pcall(function()
- sc.DecimateCheck(v)
- end)
- end
- end
- end
- else
- if(v:IsDescendantOf(game))then
- AddToDecimateTable(v)
- sc.DecimateMethods[sc.DecimateMethod].Function(v)
- for i,v in next, workspace:GetDescendants() do
- sc.UpdateIgnore()
- if(not sc.isDescendantOfIgnores(v))then
- pcall(function()
- sc.DecimateCheck(v)
- end)
- end
- end
- end
- end
- end
- }
- }
- sc.RefitMethods = {
- "Normal",
- "LagIsTheBestDefense"
- }
- function sc:Aoe(Position, Range)
- local success, parts = pcall(function()
- if(self.ClientAoe)then
- return self.RemoteFunction:InvokeClient(self:GetCurrentPlayer(), "Aoe", {
- Position,
- Range
- })
- else
- return Aoe(Position, Range)
- end
- end)
- if(not success)then
- parts = {}
- end
- task.spawn(function()
- for i,v in next, parts do
- pcall(function()
- self.UpdateIgnore()
- if(not self.isDescendantOfIgnores(v))then
- if(v.Name:lower() ~= "baseplate" and v.Name:lower() ~= "base")then
- local m = v:FindFirstAncestorOfClass("Model") or v:FindFirstAncestorOfClass("Folder") or v:FindFirstAncestorOfClass("WorldModel")
- if(m)then
- if(m:IsDescendantOf(game))then
- chatfunc(sc.KillTexts[math.random(1,#sc.KillTexts)]..m.Name)
- end
- else
- if(v:IsDescendantOf(game))then
- chatfunc(sc.KillTexts[math.random(1,#sc.KillTexts)]..v.Name)
- end
- end
- if(self.KillMethods[self.KillMethod])then
- self.KillMethods[self.KillMethod].Function(v, m)
- end
- end
- end
- end)
- end
- end)
- return parts
- end
- function sc:CleanObject(obj,keep)
- local function clean(v)
- if v:IsA("DataModelMesh") and not table.find(keep,"SpecialMesh") then
- v:Destroy()
- elseif v:IsA("MeshPart") and not table.find(keep,"MeshPart") then
- local a = Instance.new("Part", v.Parent)
- a.Name = v.Name
- a.Size = v.Size
- a.CFrame = v.CFrame
- a.Material = v.Material
- a.Color = v.Color
- a.Transparency = v.Transparency
- a.Anchored = v.Anchored
- a.CanCollide = v.CanCollide
- a.CanQuery = v.CanQuery
- a.Parent = v.Parent
- pcall(game.Destroy,v)
- elseif v:IsA("UnionOperation") and not table.find(keep,"UnionOperation")then
- local a = Instance.new("Part", v.Parent)
- a.Name = v.Name
- a.Size = v.Size
- a.CFrame = v.CFrame
- a.Material = v.Material
- a.Color = v.Color
- a.Transparency = v.Transparency
- a.Anchored = v.Anchored
- a.CanCollide = v.CanCollide
- a.CanQuery = v.CanQuery
- a.Parent = v.Parent
- pcall(game.Destroy,v)
- elseif v:IsA("Sound") and not table.find(keep,"Sound") then
- v.PlayOnRemove = false
- v:Destroy()
- elseif v:IsA("Decal") and not table.find(keep,"Decal") then
- v:Destroy()
- elseif v:IsA("JointInstance") and not table.find(keep,"JointInstance") then
- v:Destroy()
- elseif v:IsA("Script") and not table.find(keep,"Script") then
- v.Disabled = true
- v:Destroy()
- elseif v:IsA("LocalScript") and not table.find(keep,"LocalScript") then
- v.Disabled = true
- v:Destroy()
- elseif v:IsA("ModuleScript") and not table.find(keep,"ModuleScript") then
- v:Destroy()
- elseif v:IsA("Attachment") and not table.find(keep,"Attachment") then
- v:Destroy()
- elseif v:IsA("ParticleEmitter") and not table.find(keep,"ParticleEmitter") then
- v:Destroy()
- elseif v:IsA("PointLight") and not table.find(keep,"PointLight") then
- v:Destroy()
- elseif(v:IsA("GuiObject") and not table.find(keep, "GuiObject"))then
- v:Destroy()
- end
- end
- clean(obj)
- for i,v in next, obj:GetDescendants() do
- clean(v)
- end
- end
- function sc:Shatter(p) --thx WomanMalder UwU
- local function isdestroyed(inst)
- if (inst.Parent ~= nil) then return (false) end
- local _, b = pcall(function()
- inst.Parent = inst
- end)
- if(b:match('locked'))then
- return (true)
- else
- return (false)
- end
- end;
- local function Subtract(Part:BasePart,Negation:{Instance}|Instance,CollisionFidelity:Enum.CollisionFidelity|nil)
- if(CollisionFidelity==nil)then CollisionFidelity = 'Hull' end
- if(typeof(Negation)=='table')then
- for o, p in next, Negation do
- if (p:IsDescendantOf(workspace)) then
- else
- return
- end
- end
- return(Part:SubtractAsync(Negation, CollisionFidelity));
- else
- if(Part:IsDescendantOf(workspace))then
- return(Part:SubtractAsync({Negation}, CollisionFidelity));
- end
- end
- end;
- local function Fragment(Part, Count)
- local Fragments = {};
- local partSize = Part.Size;
- local partCF = Part.CFrame;
- if(Part:IsDescendantOf(workspace) and Count >= 0)then
- local c1 = Instance.new('Part')
- c1.Size = partSize*4
- c1.CFrame = partCF * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))) * CFrame.new(0, -partSize.Y * 2, 0)
- local c2 = c1:Clone()
- c2.CFrame = partCF * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))) * CFrame.new(0, partSize.Y * 2, 0)
- local p1, p2
- pcall(function()
- p1 = Subtract(Part, c1)
- p2 = Subtract(Part, c2)
- end)
- if(p1 and p2) then
- p1.CFrame = partCF * partCF:ToObjectSpace(p1.CFrame)
- p2.CFrame = partCF * partCF:ToObjectSpace(p2.CFrame)
- p1.Parent = Part.Parent
- p2.Parent = Part.Parent
- local f1 = Fragment(p1, Count-1)
- local f2 = Fragment(p2, Count-1)
- table.insert(Fragments, p1)
- table.insert(Fragments, p2)
- for i, v in next, f1 do
- table.insert(Fragments, v)
- end
- for i, v in next, f2 do
- table.insert(Fragments, v)
- end
- end
- end
- for i, v in next, Fragments do
- v.Parent = nil
- end
- if(#Fragments == 0) then
- Fragments = {Part:Clone()}
- end
- return (Fragments)
- end
- local function getbiggestaxis(vector)
- local biggest = 0
- if(vector.X>biggest)then
- biggest = vector.X
- end
- if(vector.Y>biggest)then
- biggest = vector.Y
- end
- if(vector.Z>biggest)then
- biggest = vector.Z
- end
- return biggest
- end
- local function shatterify(b)
- if(b:IsA("BasePart"))then
- pcall(function()
- if(b.Transparency >= 1)then
- pcall(game.Destroy,b)
- return
- end
- b.Anchored = true
- local fragments = Fragment(b, -1)
- pcall(game.Destroy,b)
- for i,v in next, fragments do
- pcall(function()
- task.spawn(function()
- v.Anchored = true
- v.Parent = sc.EffectModel
- v.Material = Enum.Material.Glass
- local biggest = 1+(getbiggestaxis(v.Size)/2)
- local pos = v.Position + (Vector3.new(math.random(-3,3),math.random(2,5),math.random(-3,3))*Vector3.new(biggest,biggest,biggest))
- local mag = (v.Position - pos).Magnitude
- self:ClientTween(v,TweenInfo.new((mag/2)/biggest, Enum.EasingStyle.Back),{
- Position = pos,
- Size = v.Size/3,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- })
- task.wait((mag/2)/biggest)
- if(v and v:IsDescendantOf(game))then
- local fragments2 = Fragment(v, 0)
- if(v and v:IsDescendantOf(game))then
- pcall(game.Destroy,v)
- for i,a in next, fragments2 do
- task.spawn(function()
- a.Anchored = true
- a.Parent = sc.EffectModel
- a.Material = Enum.Material.Glass
- self:SoundEffect(a,7140152893,1,math.random(70,120)/100,true)
- biggest = 1+(getbiggestaxis(a.Size)/2)
- local pos = a.Position + (Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*Vector3.new(biggest,biggest,biggest))
- local mag = (a.Position - pos).Magnitude
- self:ClientTween(a,TweenInfo.new(mag/biggest),{
- Position = pos,
- Size = Vector3.new(),
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- })
- task.wait((mag)/biggest)
- pcall(game.Destroy,a)
- end)
- end
- end
- else
- pcall(game.Destroy,v)
- end
- end)
- end)
- end
- pcall(game.Destroy,b)
- end)
- end
- end
- if(p:IsA("Model") or p:IsA("Folder") or p:IsA("WorldModel"))then
- self:SoundEffect(p:FindFirstChildWhichIsA("Part",true),9125402735,10,math.random(70,120)/100,true)
- self:CleanObject(p,{})
- for i,b in next, p:GetDescendants() do
- if(b:IsA("BasePart"))then
- coroutine.wrap(shatterify)(b)
- end
- end
- pcall(game.Destroy,p)
- elseif(p:IsA("BasePart"))then
- self:SoundEffect(p,9125402735,10,math.random(70,120)/100,true)
- self:CleanObject(p,{})
- coroutine.wrap(shatterify)(p)
- for i,v in next, p:GetDescendants() do
- if(v:IsA("BasePart"))then
- coroutine.wrap(shatterify)(v)
- end
- end
- pcall(game.Destroy,p)
- end
- end
- function sc:Raycast(Start,End,Distance,Ignore)
- local Hit,Pos,Mag,Table = nil,nil,0,{}
- local B,V = workspace:FindPartOnRayWithIgnoreList(Ray.new(Start,((CFrame.new(Start,End).lookVector).unit) * Distance),(Ignore or {}))
- if B ~= nil then
- local BO = (Start - V).Magnitude
- table.insert(Table, {Hit = B, Pos = V, Mag = BO})
- end
- for i,g in next, self.WorldModels do
- local N,M = g:FindPartOnRayWithIgnoreList(Ray.new(Start,((CFrame.new(Start,End).lookVector).unit) * Distance),(Ignore or {}))
- if N ~= nil then
- local BO = (Start - M).Magnitude
- table.insert(Table, {Hit = N, Pos = M, Mag = BO})
- end
- end
- for i,g in next, Table do
- if i == 1 then
- Mag = Table[i].Mag
- end
- if Table[i].Mag <= Mag then
- Mag = Table[i].Mag
- Hit = Table[i].Hit
- Pos = Table[i].Pos
- end
- end
- return Hit,Pos
- end
- function sc:ClientRaycast(Start,End,Distance,Ignore)
- local success, hit, pos = pcall(function()
- return self.RemoteFunction:InvokeClient(self:GetCurrentPlayer(), "Raycast", {
- Start,
- End,
- Distance,
- Ignore,
- self.WorldModels
- })
- end)
- if(success)then
- return hit, pos
- else
- return nil, Vector3.new()
- end
- end
- function sc:ClientTween(Object,Info,Goal)
- game:GetService("TweenService"):Create(Object,Info,Goal):Play()
- end
- function sc:part(cf,size,trans,mat,col,tweentime,tween)
- local p = Instance.new('Part')
- p.Anchored = true
- p.CanCollide = false
- p.Parent = self.EffectModel
- p.CFrame = cf
- p.Transparency = trans
- p.Material = mat
- p.Color = col
- p.Size = size
- p.CanQuery = false
- p.CanTouch = false
- self:ClientTween(p,TweenInfo.new(tweentime),tween)
- task.delay(tweentime, pcall, game.Destroy, p)
- return p
- end
- function sc:Wave(cframe,size,trans,col,tweenwait,tween)
- local Wavee = script.Stuff.Wave:Clone()
- Wavee.Parent = self.EffectModel
- Wavee.CFrame = cframe
- Wavee.Size = size
- Wavee.Transparency = trans
- Wavee.Color = col
- self:ClientTween(Wavee,TweenInfo.new(tweenwait),tween)
- task.delay(tweenwait, pcall, game.Destroy, Wavee)
- end
- function sc:RandomString(length)
- local a = ""
- for i = 1, length do
- a ..= string.char(math.random(1,120))
- end
- return a
- end
- local chatfuncSymbols = {
- "/",
- "|",
- "(",
- "!",
- "@",
- "#",
- "$",
- "%",
- "^",
- "&",
- "*",
- "(",
- ")",
- "<",
- ">",
- "?",
- [[\]],
- "-",
- "+",
- "~",
- "`",
- ".",
- "[",
- "]",
- "="
- }
- local chatfuncs = {}
- function sc:chatfunc(msg)
- task.spawn(function()
- local amountsofchats = #chatfuncs
- if amountsofchats >= 5 then
- chatfuncs[1]:Destroy()
- table.remove(chatfuncs, 1)
- end
- for i, v in next, chatfuncs do
- v.StudsOffset += Vector3.new(0,1.5,0)
- end
- local bil = Instance.new('BillboardGui')
- bil.Name = "EmperorChatLabelIUFH"..self.Player
- bil.Parent = workspace
- pcall(function()
- bil.Adornee = self.FakeHead.self
- end)
- bil.LightInfluence = 0
- bil.Size = UDim2.new(1000,0,1,0)
- bil.StudsOffset = Vector3.new(-0.7,2.5,0)
- table.insert(chatfuncs, bil)
- local numoftext = 0
- local letters = #msg:sub(1)
- local children = 0
- local texts = {}
- local textdebris = {}
- task.spawn(function()
- for i = 1,string.len(msg) do
- children += .05
- local txt = Instance.new("TextLabel")
- txt.Size=UDim2.new(0.001,0,1,0)
- txt.TextScaled=true
- txt.TextWrapped=true
- txt.Font=Enum.Font.GrenzeGotisch
- txt.BackgroundTransparency=1
- txt.TextStrokeTransparency=0
- txt.TextColor3 = Color3.new(0,0,1)
- txt.TextStrokeColor3 = Color3.new(0,0,0)
- txt.Position=UDim2.new(0.5-(-i*(0.001/2)),0,0.5,0)
- txt.Text=msg:sub(i,i)
- txt.ZIndex = 2
- txt.Parent=bil
- bil.StudsOffset-=Vector3.new(0.25,0,0)
- letters-=1
- table.insert(texts, txt)
- numoftext+=1
- task.delay(5.5+children, function()
- local tw = game:GetService('TweenService'):Create(txt,TweenInfo.new(.5),{
- TextTransparency = 1,
- TextStrokeTransparency = 1
- })
- tw:Play()
- tw.Completed:wait()
- txt:Destroy()
- bil.StudsOffset-=Vector3.new(0.25,0,0)
- game:GetService("TweenService"):Create(bil, TweenInfo.new(.3), {
- StudsOffset=bil.StudsOffset-Vector3.new(0.25,0,0)
- }):Play()
- children -= .1
- end)
- pcall(function()
- local s = Instance.new("Sound", self.FakeHead.self)
- s.Volume = 1
- s.SoundId = "rbxassetid://"..8549394881
- s.Pitch = math.random(80,120)/100
- s.PlayOnRemove = true
- s:Destroy()
- end)
- task.wait()
- task.wait()
- task.wait()
- end
- end)
- game:GetService("Debris"):AddItem(bil, 20)
- task.spawn(function()
- repeat
- if(not bil)or(not bil:IsDescendantOf(workspace))then
- break
- end
- pcall(function()
- task.wait()
- for i,v in next, texts do
- if(math.random(1,1000) == 1)and(string.sub(msg, i, i) ~= " ")and v:IsDescendantOf(bil)then
- local origtx = string.sub(msg, i, i)
- v.Text = chatfuncSymbols[math.random(1,#chatfuncSymbols)]
- pcall(function()
- local s = Instance.new("Sound", self.FakeHead.self)
- s.Volume = .5
- s.SoundId = "rbxassetid://"..8622488090
- s.Pitch = math.random(120,150)/100
- s.PlayOnRemove = true
- s:Destroy()
- end)
- task.spawn(function()
- for i = 1, 10 do
- v.Text = chatfuncSymbols[math.random(1,#chatfuncSymbols)]
- task.wait()
- task.wait()
- end
- v.Text = origtx
- end)
- end
- end
- end)
- until not bil:IsDescendantOf(workspace)
- end)
- task.spawn(function()
- repeat
- if(not bil)or(not bil:IsDescendantOf(workspace))then
- break
- end
- pcall(function()
- task.wait()
- if #bil:GetChildren() <= 0 then
- bil:Destroy()
- return
- end
- bil.Adornee = self.FakeHead.self
- bil.Parent = workspace
- end)
- until not bil:IsDescendantOf(workspace)
- end)
- task.spawn(function()
- repeat
- if(not bil)or(not bil:IsDescendantOf(workspace))then
- break
- end
- pcall(function()
- task.wait()
- for i,v in next, texts do
- if(v:IsDescendantOf(bil))then
- if(i ~= #texts)then
- game:GetService('TweenService'):Create(v,TweenInfo.new(.1),{
- Position = UDim2.new(0.5-(-i*(0.001/2)), 0+math.random(-2,2), 0.5, 0+math.random(-2,2)),
- Rotation = math.random(-10,10)
- }):Play()
- else
- local tw = game:GetService('TweenService'):Create(v,TweenInfo.new(.1),{
- Position = UDim2.new(0.5-(-i*(0.001/2)), 0+math.random(-2,2), 0.5, 0+math.random(-2,2)),
- Rotation = math.random(-10,10)
- })
- tw:Play()
- tw.Completed:Wait()
- end
- end
- end
- end)
- until not bil:IsDescendantOf(workspace)
- end)
- task.spawn(function()
- repeat
- if(not bil)or(not bil:IsDescendantOf(workspace))then
- break
- end
- pcall(function()
- task.wait()
- for i,v in next, texts do
- if math.random(1,10) == 1 and v:IsDescendantOf(bil) then
- local tx = v:Clone()
- tx.Parent = bil
- tx.ZIndex = 1
- table.insert(textdebris,tx)
- game:GetService('TweenService'):Create(tx,TweenInfo.new(1),{
- Position = UDim2.new(0.5-(-i*(0.001/2)), 0+math.random(-30,30), 0.5, 0+math.random(-30,30)),
- TextTransparency = 1,
- TextStrokeTransparency = 1,
- Size = UDim2.new(0,0,0),
- TextColor3 = Color3.new(0,0,0)
- }):Play()
- task.delay(1, pcall, game.Destroy, tx)
- end
- end
- task.wait(math.random())
- end)
- until not bil:IsDescendantOf(workspace)
- end)
- end)
- end
- function sc:Init()
- local self = self
- self.Player = owner.Name
- if(self.Player == "")then
- self.Player = nil
- return
- end
- task.wait()
- if(game:GetService("ReplicatedStorage"):FindFirstChild("__FakeChar"..self:GetCurrentPlayer().UserId))then
- game:GetService("ReplicatedStorage"):FindFirstChild("__FakeChar"..self:GetCurrentPlayer().UserId):Destroy()
- end
- if(game:GetService("ReplicatedStorage"):FindFirstChild("__FakeCharRemoteFunction"..self:GetCurrentPlayer().UserId))then
- game:GetService("ReplicatedStorage"):FindFirstChild("__FakeCharRemoteFunction"..self:GetCurrentPlayer().UserId):Destroy()
- end
- game:GetService("JointsService"):ClearAllChildren()
- for i, v in next, game:GetService("Players"):GetPlayers() do
- if(v:FindFirstChildOfClass("PlayerGui") and v:FindFirstChildOfClass("PlayerGui"):FindFirstChild("__Client"))then
- v:FindFirstChildOfClass("PlayerGui"):FindFirstChild("__Client"):Destroy()
- end
- end
- self.FpsValue = self:GetFpsVal()
- for i,v in next, workspace:GetDescendants() do
- if(v:IsA("WorldModel"))then
- table.insert(self.WorldModels, v)
- end
- end
- table.insert(self.Connections, workspace.DescendantAdded:Connect(function(obj)
- if(obj:IsA("WorldModel"))then
- table.insert(self.WorldModels, obj)
- end
- end))
- table.insert(self.Connections, workspace.DescendantRemoving:Connect(function(obj)
- if(obj:IsA("WorldModel") and table.find(self.WorldModels,obj))then
- table.remove(self.WorldModels, table.find(self.WorldModels,obj))
- end
- end))
- table.insert(sc.Connections, game.DescendantAdded:Connect(function(obj)
- if(not self.isDescendantOfIgnores(obj))then
- self.DecimateCheck(obj)
- end
- end))
- -- -- -- -- -- -- Setup -- -- -- -- -- --
- local sin = 0
- head = nil
- self:AddRefit(getfenv(), "head", script.Character.Head, {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- self.UpdateIgnore()
- end
- })
- self.Head = CFrame.new()
- leftarm = nil
- self:AddRefit(getfenv(), "leftarm", script.Character["Left Arm"], {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- self.UpdateIgnore()
- end
- })
- self.LeftArm = CFrame.new()
- leftleg = nil
- self:AddRefit(getfenv(), "leftleg", script.Character["Left Leg"], {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- self.UpdateIgnore()
- end
- })
- self.LeftLeg = CFrame.new()
- rightarm = nil
- self:AddRefit(getfenv(), "rightarm", script.Character["Right Arm"], {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- rightarm.self.Attachment.CFrame = CFrame.Angles(0,math.rad((sin)/self.FpsValue),0)*CFrame.new(0,-0.4, -0.7)
- rightarm.self.Attachment2.CFrame = CFrame.Angles(0,math.rad((sin)/self.FpsValue),0)*CFrame.new(0,-0.4, 0.7)
- self.UpdateIgnore()
- self.WeaponCheck()
- end,
- })
- self.RightArm = CFrame.new()
- rightleg = nil
- self:AddRefit(getfenv(), "rightleg", script.Character["Right Leg"], {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- self.UpdateIgnore()
- end,
- })
- self.RightLeg = CFrame.new()
- torso = nil
- self:AddRefit(getfenv(), "torso", script.Character.Torso, {
- DestroyAfterSeconds = .5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- torso.self.Chain.CurveSize1 = math.cos(sin/20)
- torso.self.Attachment2.CFrame = CFrame.new(1*math.sin(sin/20), .2*math.cos(sin/30), 4+.2*math.cos(sin/40))
- self.UpdateIgnore()
- end
- })
- axe = nil
- self:AddRefit(getfenv(), "axe", script.Character.Axe, {
- DestroyAfterSeconds = 5,
- Properties = {
- Parent = workspace,
- Anchored = true,
- CanTouch = false,
- CanQuery = false,
- CFrame = CFrame.new()
- },
- OnDestroy = function()
- self.UpdateIgnore()
- self.WeaponCheck()
- end,
- })
- self.Axe = CFrame.new()
- local mus = nil
- campart = nil
- self:AddRefit(getfenv(), "campart", Instance.new("Part"), {
- DestroyAfterSeconds = 5,
- OnDestroy = function()
- self:FixCam(campart.self)
- if(not mus or not mus:IsDescendantOf(campart.self))then
- pcall(game.Destroy,mus)
- mus = Instance.new("Sound", campart.self)
- mus.SoundId = "rbxassetid://"..self.Ids[self.SoundIdNum]
- if(not self.Muted)then
- mus.Volume = self.Volume
- else
- mus.Volume = 0
- end
- mus.Pitch = self.Pitch
- mus.TimePosition = self.TimePos
- mus.Looped = true
- mus:Play()
- elseif(mus and mus:IsDescendantOf(campart.self))then
- self.TimePos = mus.TimePosition
- mus.SoundId = "rbxassetid://"..self.Ids[self.SoundIdNum]
- if(not self.Muted)then
- mus.Volume = self.Volume
- else
- mus.Volume = 0
- end
- mus.Pitch = self.Pitch
- mus.Looped = true
- mus:Resume()
- end
- if(musval)then
- musval.self.Value = mus
- end
- self.UpdateIgnore()
- end,
- DisableDescendantChecks = true,
- Properties = {
- Parent = game:GetService('JointsService'),
- Size = Vector3.new(),
- CFrame = CFrame.new(),
- Transparency = 1
- }
- })
- task.spawn(function()
- task.wait(1/30)
- self:FixCam(campart.self)
- end)
- headval = nil
- self:AddRefit(getfenv(), "headval", Instance.new("ObjectValue"), {
- DestroyAfterSeconds = .5,
- OnDestroy = function()
- headval.self.Value = head.self
- end,
- Properties = {
- Name = "__FakeCharHead"..self:GetCurrentPlayer().UserId,
- Parent = game:GetService("JointsService")
- }
- })
- self.FakeHead = head
- musval = nil
- self:AddRefit(getfenv(), "musval", Instance.new("ObjectValue"), {
- DestroyAfterSeconds = .5,
- OnDestroy = function()
- musval.self.Value = mus
- end,
- Properties = {
- Name = "__FakeCharMusic"..self:GetCurrentPlayer().UserId,
- Parent = game:GetService("JointsService")
- }
- })
- self.Killaura = false
- function chatfunc(msg)
- sc:chatfunc(msg)
- end
- self.SmokeTime = 0
- self.W = false
- self.A = false
- self.S = false
- self.D = false
- self.CameraCFrame = CFrame.new()
- self.ShiftLock = false
- self.MouseHit = CFrame.new()
- self.RemoteFuncs = function(Player, Type, Data)
- if(Player ~= self:GetCurrentPlayer())then
- return
- end
- if(Type == "MouseHit")then
- local hit, pos = self:ClientRaycast(self.CameraCFrame.Position, Data.Value.Position, 9999999999, self.Ignore)
- if(hit)then
- self.MouseHit = CFrame.new(pos.X,pos.Y,pos.Z)
- else
- self.MouseHit = Data.Value
- end
- end
- if(Type == "Mouse")then
- if Data.Key=="w" then
- if Data.Up==false then
- self.W=true
- elseif Data.Up==true then
- self.W=false
- end
- end
- if Data.Key=="a" then
- if Data.Up==false then
- self.A=true
- elseif Data.Up==true then
- self.A=false
- end
- end
- if Data.Key=="s" then
- if Data.Up==false then
- self.S=true
- elseif Data.Up==true then
- self.S=false
- end
- end
- if Data.Key=="d" then
- if Data.Up==false then
- self.D=true
- elseif Data.Up==true then
- self.D=false
- end
- end
- if(Data.Key == "space")and(not Data.Up)then
- if(not self.Falling and not self.Jumping and not self.Flying)then
- self.Velocity = Vector3.new(self.Velocity.X,1,self.Velocity.Z)
- self.Jumping = true
- end
- end
- if(Data.Key == "f")and(not Data.Up)then
- self.Velocity = Vector3.new()
- self.Falling = false
- self.Jumping = false
- self.Flying = not self.Flying
- end
- if(Data.Key == "p")and(not Data.Up)then
- self.RefitCore.Remove()
- end
- if(Data.Key == "z")and(not Data.Up)and(not self.AxeEnabled)then
- self.Attack = true
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/36),0)*CFrame.Angles(math.rad(0+5*math.cos(sin/32)),math.rad(30+5*math.cos(sin/35)),math.rad(-5+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10),math.rad(0)),
- CFrame.new(1.5+.5,0+.3-.1*math.cos(sin/35),-0.3)*CFrame.Angles(math.rad(90+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/30)),math.rad(50-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-30),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-50+1*math.cos(sin/35)),math.rad(0-1*math.cos(sin/33))),
- },.3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- for i = 1,math.random(1,20) do
- self:Effect(rightarm.self.HandCannon.Hole.Position, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), .5, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = rightarm.self.HandCannon.Hole.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- },{
- Scale = Vector3.new()
- })
- self:Effect(self.MouseHit.Position, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), .5, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = self.MouseHit.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- },{
- Scale = Vector3.new()
- })
- end
- self:SpawnTrail(rightarm.self.HandCannon.Hole.Position, self.MouseHit.Position, Color3.new(0,0,1), .5)
- self:SoundEffect(rightarm.self.HandCannon.Hole, 9058737882, 2, math.random(90,110)/100, true)
- self:SoundEffect(rightarm.self.HandCannon.Hole, 9060276709, 1, math.random(90,110)/100, true)
- self.SmokeTime += self:GetFramesToSecond(3)
- self:Aoe(self.MouseHit.Position, 3)
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/36),0)*CFrame.Angles(math.rad(0+5*math.cos(sin/32)),math.rad(30+5*math.cos(sin/35)),math.rad(-5+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10),math.rad(0)),
- CFrame.new(1.5+.5,0+.3-.1*math.cos(sin/35),-0.3)*CFrame.Angles(math.rad(120+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/30)),math.rad(50-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-30),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-50+1*math.cos(sin/35)),math.rad(0-1*math.cos(sin/33))),
- },.3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- self.Attack = false
- end
- if(Data.Key == "c")and(not Data.Up)and(not self.AxeEnabled)then
- self.Attack = true
- local sparking = true
- local lastlightning = tick()
- local part = Instance.new("Part", self.EffectModel)
- part.Anchored = true
- part.CanCollide = false
- part.CanQuery = false
- part.Color = Color3.new(0,0,.7)
- part.Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- part.Position = (leftarm.self.CFrame*CFrame.new(0,-1,0)).Position
- part.Size = Vector3.new(.3,.3,.3)
- part.Material = Enum.Material.Glass
- local cursor = script.Stuff.CursorHit:Clone()
- cursor.Parent = self.EffectModel
- local param = RaycastParams.new()
- param.FilterDescendantsInstances = self.Ignore
- local size = 0
- task.spawn(function()
- while sparking do
- self.Animate({
- CFrame.new(-0.0165080037, 0, -0.002173702, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.68117309, 0.600000203, -0.676147878, 0.965925813, 0.224143684, -0.129409224, 1.80666973e-07, -0.50000006, -0.866025388, -0.258818716, 0.836516321, -0.482963055)*CFrame.Angles(math.rad(0+5*math.cos(sin/32)),math.rad(0+5*math.cos(sin/35)),math.rad(0+5*math.cos(sin/34))),
- CFrame.new(-0.500000656, -2, 4.32133675e-07, 0.965925813, 0, 0.258819044, 0, 1, 0, -0.258819044, 0, 0.965925813),
- CFrame.new(1.59836626, -0.0565129519, -0.238548517, 0.87782234, -0.429628849, -0.211770743, 0.159562185, 0.679161251, -0.716435492, 0.451627851, 0.595112503, 0.664735436)*CFrame.Angles(math.rad(0+5*math.cos(sin/35)),math.rad(0+5*math.cos(sin/33)),math.rad(0+5*math.cos(sin/38))),
- CFrame.new(0.499998301, -2, 1.02818012e-06, 0.866025329, 0, -0.500000179, 0, 1, 0, 0.500000179, 0, 0.866025329),
- CFrame.new(0.0165081024, 1.5, -0.00217294693, 0.866025448, 0, 0.499999791, 0, 1, 0, -0.499999791, 0, 0.866025448)
- }, .1 / self.FpsValue)
- size += .005
- if(tick() - lastlightning)>=.3 then
- local dist = 1+size
- self:Lightning((leftarm.self.CFrame*CFrame.new(0,-1+(-.3-size),0)).Position+Vector3.new(math.random(-dist,dist),math.random(-dist,dist),math.random(-dist,dist)), (leftarm.self.CFrame*CFrame.new(0,-1+(-.3-size),0)).Position+Vector3.new(math.random(-dist,dist),math.random(-dist,dist),math.random(-dist,dist)), 3*dist, 3, Color3.new(0,0,1), .3)
- lastlightning = tick()
- end
- local p = Instance.new("Part", self.EffectModel)
- p.Anchored = true
- p.CanCollide = false
- p.CanQuery = false
- p.Color = Color3.new(0,0,.7)
- p.Material = Enum.Material.Glass
- p.Size = Vector3.new(.3+size,.3+size,.3+size)
- p.Position = (leftarm.self.CFrame*CFrame.new(0,-1+(-.3-size),0)).Position
- p.Orientation = Vector3.new(sin/3,sin/2,sin)
- self:ClientTween(p, TweenInfo.new(.5), {
- Size = Vector3.new(.3+size+.2,.3+size+.2,.3+size+.2),
- Transparency = 1,
- Color = Color3.new(0,0,1)
- })
- task.delay(.5, pcall, game.Destroy, p)
- part.Size = Vector3.new(.3+size,.3+size,.3+size)
- part.Position = (leftarm.self.CFrame*CFrame.new(0,-1+(-.3-size),0)).Position
- part.Orientation = Vector3.new(sin/3,sin/2,sin)
- param.FilterDescendantsInstances = self.Ignore
- local ray = workspace:Raycast(self.CameraCFrame.Position, (self.MouseHit.Position - self.CameraCFrame.Position)*2, param)
- if(ray)then
- cursor.CFrame = cursor.CFrame:Lerp(CFrame.new(ray.Position, ray.Position + ray.Normal) * CFrame.Angles(math.rad(-90), math.rad(sin%360), 0), .3)
- end
- game:GetService("RunService").PostSimulation:Wait()
- end
- end)
- task.wait(5)
- sparking = false
- local hit = self.MouseHit
- local ray = workspace:Raycast(self.CameraCFrame.Position, (self.MouseHit.Position - self.CameraCFrame.Position)*2, param)
- if(not ray)then
- self.Attack = false
- return
- end
- self:ClientTween(cursor, TweenInfo.new(1, Enum.EasingStyle.Exponential), {
- Size = Vector3.new(10,0.1,10),
- CFrame = CFrame.new(ray.Position, ray.Position + ray.Normal) * CFrame.Angles(math.rad(-90), math.rad(cursor.Orientation.Z+360), 0)
- })
- self:ClientTween(cursor.Decal, TweenInfo.new(1, Enum.EasingStyle.Exponential),{
- Transparency = 1
- })
- task.delay(1, pcall, game.Destroy, cursor)
- for i = 1, self:GetFramesToSecond(.1) do
- self.Animate({
- CFrame.new(-0.0165080037, 0, -0.002173702, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.55176365, 1.1000005, -0.193184972, 0.965925872, 0.129409432, -0.224143475, 1.0430815e-07, -0.866025388, -0.50000006, -0.258818626, 0.482962996, -0.83651638),
- CFrame.new(-0.500000656, -2, 4.32133675e-07, 0.965925813, 0, 0.258819044, 0, 1, 0, -0.258819044, 0, 0.965925813),
- CFrame.new(1.59836626, -0.0565129519, -0.238548517, 0.87782234, -0.429628849, -0.211770743, 0.159562185, 0.679161251, -0.716435492, 0.451627851, 0.595112503, 0.664735436),
- CFrame.new(0.499998301, -2, 1.02818012e-06, 0.866025329, 0, -0.500000179, 0, 1, 0, 0.500000179, 0, 0.866025329),
- CFrame.new(0.0682707876, 1.49999988, 0.191012651, 0.87500006, 0.129409418, 0.466506183, 0.129409522, 0.866025388, -0.482962906, -0.466506153, 0.482962936, 0.741025448)
- }, .3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- for i = 1,math.random(1,5) do
- self:Lightning(part.Position, part.Position + Vector3.new(0,80,0), 1, 15, Color3.new(0,0,1), .5+size/2)
- end
- pcall(game.Destroy, part)
- for i = 1, self:GetFramesToSecond(.5) do
- self.Animate({
- CFrame.new(-0.0165080037, 0, -0.002173702, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.55176365, 1.1000005, -0.193184972, 0.965925872, 0.129409432, -0.224143475, 1.0430815e-07, -0.866025388, -0.50000006, -0.258818626, 0.482962996, -0.83651638),
- CFrame.new(-0.500000656, -2, 4.32133675e-07, 0.965925813, 0, 0.258819044, 0, 1, 0, -0.258819044, 0, 0.965925813),
- CFrame.new(1.59836626, -0.0565129519, -0.238548517, 0.87782234, -0.429628849, -0.211770743, 0.159562185, 0.679161251, -0.716435492, 0.451627851, 0.595112503, 0.664735436),
- CFrame.new(0.499998301, -2, 1.02818012e-06, 0.866025329, 0, -0.500000179, 0, 1, 0, 0.500000179, 0, 0.866025329),
- CFrame.new(0.0682707876, 1.49999988, 0.191012651, 0.87500006, 0.129409418, 0.466506183, 0.129409522, 0.866025388, -0.482962906, -0.466506153, 0.482962936, 0.741025448)
- }, .1 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- task.delay(3, function()
- for i = 1, math.random(1,5) do
- self:Lightning(hit.Position + Vector3.new(0,80,0), hit.Position, 1, 15, Color3.new(0,0,1), .5+size/2)
- end
- task.wait(.5)
- local sparking = true
- local lastspark = tick()
- local p = Instance.new("Part", self.EffectModel)
- p.Anchored = true
- p.CanCollide = false
- p.CanQuery = false
- p.Transparency = 1
- p.CFrame = hit
- self:SoundEffect(p, 165796875, 10, 1, false)
- task.spawn(function()
- while sparking do
- if(tick() - lastspark)>=.2 then
- self:Lightning(hit.Position + Vector3.new(math.random(-7, 7),math.random(-7, 7),math.random(-7, 7)), hit.Position + Vector3.new(math.random(-7, 7),math.random(-7, 7),math.random(-7, 7)), 10, 15, Color3.new(0,0,1), .5)
- lastspark = tick()
- end
- game:GetService("RunService").PostSimulation:Wait()
- end
- end)
- task.wait(2)
- sparking = false
- self:SoundEffect(p, 4988868452, 10, 1, true)
- task.delay(0, pcall, game.Destroy, p)
- local done = false
- local p2 = self:part(CFrame.new(hit.Position),Vector3.new(30,30,30),0,Enum.Material.Neon,Color3.new(0,0,1),10,{
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- })
- p = self:part(CFrame.new(hit.Position)*CFrame.new(0,2048/2,0),Vector3.new(15,2048,15),0,Enum.Material.Neon,Color3.new(0,0,1),10,{
- Transparency = 1,
- Orientation = Vector3.new(0,math.random(-360,360),0)
- })
- local start = tick()
- task.spawn(function()
- pcall(function()
- local a = 0
- local b = false
- repeat
- game:GetService("RunService").PostSimulation:Wait()
- a += 1
- if a >= 10 then
- a = 0
- b = not b
- if b == true then
- self:ClientTween(p,TweenInfo.new(.5),{
- Size = Vector3.new(15/2,2048,15/2)
- })
- elseif b == false then
- self:ClientTween(p,TweenInfo.new(.5),{
- Size = Vector3.new(15,2048,15)
- })
- end
- end
- until done == true
- end)
- end)
- task.spawn(function()
- pcall(function()
- repeat
- game:GetService("RunService").PostSimulation:Wait()
- self:Wave(CFrame.new(hit.Position),Vector3.new(0,0,0),(tick() - start)/10,Color3.new(0,0,1),.5,{
- Size = Vector3.new(70,5,70),
- Transparency = 1,
- Orientation = Vector3.new(0,math.random(-360,360),0)
- })
- if(tick() - start)<=7 then
- if(math.random(1,8)) == 1 then
- self:Lightning(hit.Position + Vector3.new(math.random(-40, 40),math.random(-5, 40),math.random(-40, 40)), hit.Position + Vector3.new(math.random(-40, 40),math.random(-5, 40),math.random(-40, 40)), 10, 15, Color3.new(0,0,1), math.random(80,300)/100)
- lastspark = tick()
- end
- end
- self:Aoe(hit.Position, 50)
- until done == true
- end)
- end)
- repeat game:GetService("RunService").PostSimulation:Wait() until not p2:IsDescendantOf(workspace)
- done = true
- end)
- self.Attack = false
- end
- if(Data.Key == "v")and(not Data.Up)and(not self.AxeEnabled)then
- self.Attack = true
- leftarm.self.Sword.Transparency = .99
- leftarm.self.Sword.Material = Enum.Material.Glass
- leftarm.self.Sword.Highlight.Enabled = true
- for i = 1, self:GetFramesToSecond(.7) do
- self.Animate({
- CFrame.new(-0.0529786237, 0, -0.00697433716, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.59793985, 0.738437891, -0.365518063, 0.875000179, 0.129409432, -0.466506004, -0.129409432, -0.866025388, -0.482962996, -0.466506004, 0.482962996, -0.741025686)*CFrame.Angles(math.rad(0+5*math.cos(sin/33)),math.rad(0+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/40))),
- CFrame.new(-0.551762879, -2, -0.193185553, 0.939692557, 0, 0.342020094, 0, 1, 0, -0.342020094, 0, 0.939692557),
- CFrame.new(1.52579713, -0.0742611289, -0.423438966, 0.842993081, -0.31206122, -0.438155591, -0.0123708099, 0.803068221, -0.595758557, 0.537782013, 0.507640779, 0.673120499)*CFrame.Angles(math.rad(0+5*math.cos(sin/35)),math.rad(0+5*math.cos(sin/33)),math.rad(0+5*math.cos(sin/38))),
- CFrame.new(0.570710957, -2, -0.12247543, 0.866025329, 0, -0.500000179, 0, 1, 0, 0.500000179, 0, 0.866025329),
- CFrame.new(0.0788603872, 1.49999988, 0.0896173641, 0.965925872, 0.0449434146, 0.254886806, 0, 0.984807789, -0.173648164, -0.258818835, 0.167731255, 0.951251328)
- }, .1 / self.FpsValue)
- leftarm.self.Sword.Transparency = .99
- leftarm.self.Sword.Material = Enum.Material.Glass
- leftarm.self.Sword.Highlight.Enabled = true
- game:GetService("RunService").PostSimulation:Wait()
- end
- self:SoundEffect(leftarm.self.Sword, 7171591581, 3, math.random(90, 110)/100, true)
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(-0.0529786237, 0, -0.00697433716, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.50579524, -0.147885561, -0.408005863, 0.97209996, 0.151094601, 0.179421127, 0.00389319658, 0.754406452, -0.656396031, -0.234534308, 0.638781071, 0.732770324)*CFrame.Angles(math.rad(0+5*math.cos(sin/35)),math.rad(0+5*math.cos(sin/33)),math.rad(0+5*math.cos(sin/38))),
- CFrame.new(-0.551762879, -2, -0.193185553, 0.939692557, 0, 0.342020094, 0, 1, 0, -0.342020094, 0, 0.939692557),
- CFrame.new(1.52579713, -0.0742611289, -0.423438966, 0.842993081, -0.31206122, -0.438155591, -0.0123708099, 0.803068221, -0.595758557, 0.537782013, 0.507640779, 0.673120499)*CFrame.Angles(math.rad(0+5*math.cos(sin/33)),math.rad(0+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/40))),
- CFrame.new(0.570710957, -2, -0.12247543, 0.866025329, 0, -0.500000179, 0, 1, 0, 0.500000179, 0, 0.866025329),
- CFrame.new(0.0529785305, 1.50000024, -0.00697511621, 0.965925872, -0.0225574989, 0.257833958, 0, 0.99619472, 0.0871555507, -0.258818835, -0.0841858014, 0.962250233)
- }, .3 / self.FpsValue)
- leftarm.self.Sword.Transparency = .99
- leftarm.self.Sword.Material = Enum.Material.Glass
- leftarm.self.Sword.Highlight.Enabled = true
- game:GetService("RunService").PostSimulation:Wait()
- end
- self:SoundEffect(leftarm.self.Sword, 7171761940, 3, math.random(90, 110)/100, true)
- local p = script.Stuff.SlashPart:Clone()
- p.Parent = self.EffectModel
- p.Anchored = true
- p.CanCollide = false
- p.CanTouch = false
- p.CanQuery = false
- p.Material = Enum.Material.Neon
- p.Size = Vector3.new(.3,.1,80)
- p.CFrame = self.CurrentPosition*CFrame.new(1.5,-3,(p.Size.Z/2)+5)
- for i = 1, self:GetFramesToSecond(1) do
- leftarm.self.Sword.Transparency = .99
- leftarm.self.Sword.Material = Enum.Material.Glass
- leftarm.self.Sword.Highlight.Enabled = true
- game:GetService("RunService").PostSimulation:Wait()
- end
- self:ClientTween(p, TweenInfo.new(1), {
- Transparency = 1
- })
- for i,v in next, p:GetChildren() do
- pcall(function()
- self:ClientTween(v, TweenInfo.new(1), {
- Rate = 0,
- Velocity = Vector3.new(v.Velocity.X,300,v.Velocity.Z)
- })
- end)
- task.delay(1, function()
- pcall(function()
- v.Enabled = false
- end)
- end)
- end
- task.delay(5, pcall, game.Destroy, p)
- task.delay(.3, function()
- self:Aoe(p.CFrame, Vector3.new(10, 200, p.Size.Z))
- for i = 1, p.Size.Z/2 do
- local s = script.Stuff.Spike:Clone()
- s.Parent = self.EffectModel
- s.Size = Vector3.new(2,0,2)
- s.Color = Color3.new(0,0,math.random())
- s.Material = Enum.Material.Glass
- s.CFrame = p.CFrame*CFrame.new(0,-(2+i)/2,(i*2)-(p.Size.Z/2))
- local t = i/math.random(10,20)
- local siz = 10+(i*(math.random(80, 200)/100))
- self:ClientTween(s, TweenInfo.new(t), {
- CFrame = p.CFrame*CFrame.new(0,siz/2,(i*2)-(p.Size.Z/2))*CFrame.Angles(math.rad(math.random(-10,10)), math.rad(math.random(-10,10)), math.rad(math.random(-10,10))),
- Size = Vector3.new(2,siz,2)
- })
- task.delay(t/3,function()
- self:SoundEffect(s, 4471648128, 3, math.random(80, 120)/100, false)
- end)
- task.delay(t+2, function()
- self:ClientTween(s, TweenInfo.new((t/2)+1), {
- CFrame = p.CFrame*CFrame.new(0,-siz/2,(i*2)-(p.Size.Z/2))*CFrame.Angles(math.rad(math.random(-10,10)), math.rad(math.random(-10,10)), math.rad(math.random(-10,10))),
- Size = Vector3.new(2,0,2)
- })
- task.delay((t/2)+1, pcall, game.Destroy, s)
- end)
- end
- end)
- leftarm.self.Sword.Transparency = 1
- leftarm.self.Sword.Material = Enum.Material.Plastic
- leftarm.self.Sword.Highlight.Enabled = false
- self.Attack = false
- end
- if(Data.Key == "leftcontrol")and(not Data.Up)then
- if(self.WalkSpeed == 16)then
- self.WalkSpeed = 32
- else
- self.WalkSpeed = 16
- end
- end
- if(Data.Key == "m")and(not Data.Up)then
- self.Muted = not self.Muted
- end
- if(Data.Key == "t")and(not Data.Up)then
- local taunts = {
- {
- Id = 966261603,
- Text = "My vision for the world shall be realized."
- },
- {
- Id = 966262774,
- Text = "Don't you dare keep me waiting."
- },
- {
- Id = 966264954,
- Text = "Feel the fury of a god!"
- },
- {
- Id = 966268002,
- Text = "You will kneel before me."
- },
- {
- Id = 966269704,
- Text = "A peaceful world has no need for humans. You're pointless!"
- },
- {
- Id = 966270845,
- Text = "How dare you defy a god."
- }
- }
- local t = taunts[math.random(1,#taunts)]
- self:SoundEffect(head.self, t.Id, 8, math.random(90,110)/100, true)
- chatfunc(t.Text)
- end
- if(Data.Key == "semicolon")and(not Data.Up)then
- self.Killaura = not self.Killaura
- chatfunc("Killaura = "..tostring(self.Killaura))
- end
- if(Data.Key == "q")and(not Data.Up)then
- self:Effect(self.CurrentPosition.Position, 0, Vector3.new(5,5,5), Color3.new(0,0,1), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new()
- })
- self:Effect(self.MouseHit.Position+Vector3.new(0,3.1,0), 0, Vector3.new(5,5,5), Color3.new(0,0,1), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new()
- })
- for i = 1,3 do
- self:Lightning(self.CurrentPosition.Position, self.MouseHit.Position+Vector3.new(0,3.1,0), 1, 5, Color3.new(0,0,1), .3)
- end
- self.CurrentPosition = CFrame.new(self.MouseHit.Position+Vector3.new(0,3.1,0))
- self.FakeCurrentPosition = self.CurrentPosition
- end
- if(Data.Key == "x")and(not Data.Up)and(not self.AxeEnabled)then
- self.Attack = true
- local orighit = self.MouseHit.Position
- local part = Instance.new("Part", self.EffectModel)
- part.Anchored = true
- part.CanCollide = false
- part.CanQuery = false
- part.Color = Color3.new(0,0,math.random())
- part.Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- part.Position = (leftarm.self.CFrame*CFrame.new(0,-1,0)).Position
- part.Size = Vector3.new(.5,.5,.5)
- part.Material = Enum.Material.Glass
- self:SoundEffect(leftarm.self, 3750951732, 1, math.random(90,110)/100, true)
- for i = 1, self:GetFramesToSecond(1.5) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(20),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/36),0.5)*CFrame.Angles(math.rad(-50+5*math.cos(sin/32)),math.rad(20+5*math.cos(sin/35)),math.rad(10+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10+1*math.cos(sin/54)),math.rad(0+1*math.cos(sin/50))),
- CFrame.new(1.5,0+1-.1*math.cos(sin/35),0)*CFrame.Angles(math.rad(180+5*math.cos(sin/34)),math.rad(0+5*math.cos(sin/38)),math.rad(5-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-10-1*math.cos(sin/56)),math.rad(0-1*math.cos(sin/53))),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/31)),math.rad(-20+3*math.cos(sin/35)),math.rad(0-3*math.cos(sin/39))),
- },.1 / self.FpsValue)
- self:Effect(leftarm.self.CFrame*CFrame.new(math.random(-2,2),-1+math.random(-2,2),math.random(-2,2)), 0, Vector3.new(.3,.3,.3), Color3.new(0,0,math.random()), 1, {
- Position = (leftarm.self.CFrame*CFrame.new(0,-1,0)).Position,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Transparency = 1
- },{
- Scale = Vector3.new(0,0,0)
- })
- part.Position = (leftarm.self.CFrame*CFrame.new(0,-1,0)).Position
- game:GetService("RunService").PostSimulation:Wait()
- end
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(-20),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0.2+.1*math.cos(sin/36),-0.5)*CFrame.Angles(math.rad(80+5*math.cos(sin/32)),math.rad(-20+5*math.cos(sin/35)),math.rad(-20+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10+1*math.cos(sin/54)),math.rad(0+1*math.cos(sin/50))),
- CFrame.new(1.5,0+1-.1*math.cos(sin/35),0)*CFrame.Angles(math.rad(180+5*math.cos(sin/34)),math.rad(0+5*math.cos(sin/38)),math.rad(5-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-10-1*math.cos(sin/56)),math.rad(0-1*math.cos(sin/53))),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/31)),math.rad(20+3*math.cos(sin/35)),math.rad(0-3*math.cos(sin/39))),
- },.3 / self.FpsValue)
- part.Position = (leftarm.self.CFrame*CFrame.new(0,-1,0)).Position
- game:GetService("RunService").PostSimulation:Wait()
- end
- self:SoundEffect(leftarm.self, 608600954, 3, math.random(90,110)/100, true)
- local pos = orighit+Vector3.new(0,40+math.random(-2,2),0)
- local mag = (pos - orighit).Magnitude
- local bez = bezier.new((leftarm.self.CFrame*CFrame.new(0,-1,0)).Position,pos+Vector3.new(0,mag*2,0),pos)
- task.spawn(function()
- for i = 0, 1, 1/240 do
- for i = 1, self:GetFramesToSecond(1/240) do
- game:GetService("RunService").PostSimulation:Wait()
- end
- end
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/36),0)*CFrame.Angles(math.rad(0+5*math.cos(sin/32)),math.rad(30+5*math.cos(sin/35)),math.rad(-5+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10),math.rad(0)),
- CFrame.new(1.5+.5,0+.3-.1*math.cos(sin/35),-0.3)*CFrame.Angles(math.rad(100+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/30)),math.rad(50-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-30),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-50+1*math.cos(sin/35)),math.rad(0-1*math.cos(sin/33))),
- },.3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- for i = 1, self:GetFramesToSecond(.6) do
- game:GetService("RunService").PostSimulation:Wait()
- end
- repeat game:GetService("RunService").PostSimulation:Wait() until (part.Position == pos) or (not part or not part:IsDescendantOf(workspace))
- self:SpawnTrail(rightarm.self.HandCannon.Hole.Position, part.Position, Color3.new(0,0,1), .5)
- self:SoundEffect(rightarm.self.HandCannon.Hole, 9058737882, 2, math.random(90,110)/100, true)
- self:SoundEffect(rightarm.self.HandCannon.Hole, 9060276709, 1, math.random(90,110)/100, true)
- self.SmokeTime += self:GetFramesToSecond(3)
- for i = 1,math.random(1,20) do
- self:Effect(rightarm.self.HandCannon.Hole.Position, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), .5, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = rightarm.self.HandCannon.Hole.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- },{
- Scale = Vector3.new()
- })
- self:Effect(part.Position, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), .5, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = self.MouseHit.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- },{
- Scale = Vector3.new()
- })
- end
- self:Effect(part.Position, 0, Vector3.new(10,10,10), Color3.new(0,0,math.random()), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new()
- })
- for i = 1, self:GetFramesToSecond(.3) do
- self.Animate({
- CFrame.new(0,0+.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/36),0)*CFrame.Angles(math.rad(0+5*math.cos(sin/32)),math.rad(30+5*math.cos(sin/35)),math.rad(-5+5*math.cos(sin/34))),
- CFrame.new(-0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(10),math.rad(0)),
- CFrame.new(1.5+.5,0+.3-.1*math.cos(sin/35),-0.3)*CFrame.Angles(math.rad(130+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/30)),math.rad(50-5*math.cos(sin/32))),
- CFrame.new(0.5,-2-.1*math.cos(sin/30),0+math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-30),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)),math.rad(-50+1*math.cos(sin/35)),math.rad(0-1*math.cos(sin/33))),
- },.3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- self.Attack = false
- end)
- for i = 0, 1, 1/60 do
- local pos = bez.calc(i)
- part.CFrame = CFrame.lookAt(part.Position, pos)
- part.Position = pos
- for i = 1, self:GetFramesToSecond(1/60) do
- game:GetService("RunService").PostSimulation:Wait()
- end
- end
- self:SoundEffect(part, 4458749278, 10, math.random(90,110)/100, true)
- pcall(game.Destroy,part)
- for i = 1, 40 do
- local siz = math.random(40, 60)
- local siz2 = math.random(40, 60)
- self:Effect(pos, 0, Vector3.new(siz, 1, siz2), Color3.new(0,0,math.random()), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-10,10),math.random(-360,360),math.random(-10,10))
- }, {
- Scale = Vector3.new()
- })
- local posa = pos+Vector3.new(math.random(-siz,siz)/2,0,math.random(-siz2,siz2)/2)
- local hit, pos2 = self:Raycast(posa, posa+Vector3.new(math.random(-siz,siz),-99999,math.random(-siz2,siz2)), 999999, self.Ignore)
- if(hit)then
- local cf = CFrame.lookAt(pos+Vector3.new(math.random(-siz,siz)/2,0,math.random(-siz2,siz2)/2), pos2)
- local mag = (cf.Position - pos2).Magnitude
- self:Effect(cf, 0, Vector3.new(.5,.5,.5), Color3.new(0,0,math.random()), mag/70, {
- Position = pos2,
- Color = Color3.new()
- },{
- Scale = Vector3.new(.5,.5,5)*20
- })
- task.delay(mag/70,function()
- local part = Instance.new("Part", self.EffectModel)
- part.Anchored = true
- part.CanCollide = false
- part.CanQuery = false
- part.Color = Color3.new(0,0,math.random())
- part.Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- part.Position = pos2
- part.Size = Vector3.new(1,1,1)
- part.Material = Enum.Material.Glass
- part.Transparency = 1
- self:SoundEffect(part, 3750959938, 5, math.random(90,110)/100, true)
- game:GetService("Debris"):AddItem(part,0)
- self:Effect(pos2, 0, Vector3.new(math.random(5,10),math.random(5,10),math.random(5,10)), Color3.new(0,0,math.random()), math.random(1,2), {
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Color = Color3.new()
- },{
- Scale = Vector3.new(0,0,0)
- })
- self:Aoe(pos2, 15)
- for i = 1, math.random(1,5) do
- local randompos = math.random(-30,30)
- local randompos2 = math.random(-30,30)
- local yrand = math.random(15,30)
- local hit, pos3 = self:Raycast(pos2+Vector3.new(randompos,yrand,randompos2), pos2+Vector3.new(randompos,-9999,randompos2), 999999, self.Ignore)
- local poss1, poss2, poss3 = pos2, pos2+Vector3.new(randompos,yrand,randompos2), pos3
- local bez = bezier.new(poss1,poss2,poss3)
- local part = Instance.new("Part", self.EffectModel)
- part.Anchored = true
- part.CanCollide = false
- part.CanQuery = false
- part.Color = Color3.new(0,0,math.random())
- part.Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- part.Position = poss1
- part.Size = Vector3.new(1,1,1)
- part.Material = Enum.Material.Glass
- task.spawn(function()
- local t = math.random(50,70)
- for i = 0, 1, 1/t do
- local pos = bez.calc(i)
- part.CFrame = CFrame.lookAt(part.Position, pos)
- part.Position = pos
- for i = 1, self:GetFramesToSecond(1/t) do
- game:GetService("RunService").PostSimulation:Wait()
- end
- end
- local posss = part.Position
- self:SoundEffect(part, 8388603871, math.random(1,3)/2, math.random(90,110)/100, true)
- pcall(game.Destroy,part)
- self:Effect(posss, 0, Vector3.new(5,5,5), Color3.new(0,0,math.random()), math.random(), {
- Transparency = 1,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Color = Color3.new(0,0,0)
- },{
- Scale = Vector3.new()
- })
- self:Aoe(posss, 7)
- end)
- end
- end)
- end
- task.wait(0.1)
- end
- end
- if(Data.Key == "n")and(not Data.Up)then
- if(self.Ids[self.SoundIdNum+1])then
- self.SoundIdNum += 1
- else
- self.SoundIdNum = 1
- end
- end
- if(Data.Key == "quote")and(not Data.Up)then
- self.ClientAoe = not self.ClientAoe
- chatfunc("ClientAoe = "..tostring(self.ClientAoe))
- end
- if(Data.Key == "l")and(not Data.Up)then
- self.Pitch = self.Pitch == 0.8 and 1 or 0.8
- chatfunc("Pitch = "..tostring(self.Pitch))
- end
- if(Data.Key == "k")and(not Data.Up)then
- self.KillMethod += 1
- if(self.KillMethod > #self.KillMethods)then
- self.KillMethod = 1
- end
- chatfunc("Kill method = "..self.KillMethods[self.KillMethod].Name)
- end
- if(Data.Key == "j")and(not Data.Up)then
- self.DecimateMethod += 1
- if(self.DecimateMethod > #self.DecimateMethods)then
- self.DecimateMethod = 1
- end
- chatfunc("Decimate method = "..self.DecimateMethods[self.DecimateMethod].Name)
- end
- if(Data.Key == "h")and(not Data.Up)then
- Decimated = {}
- for i,v in next, self.DecimateConnections do
- pcall(function()
- v:Disconnect()
- end)
- end
- self.DecimateConnections = {}
- chatfunc("Cleared decimate table.")
- end
- if(Data.Key == "g")and(not Data.Up)then
- self.RefitMethod += 1
- if(self.RefitMethod > #self.RefitMethods)then
- self.RefitMethod = 1
- end
- refitcore:SetMethod(self.RefitMethods[self.RefitMethod])
- chatfunc("Refit method = "..self.RefitMethods[self.RefitMethod])
- end
- if(Data.Key == "e")and(not Data.Up)then
- self.AxeEnabled = not self.AxeEnabled
- if(self.AxeEnabled)then
- axe.self:Destroy()
- else
- rightarm.self:Destroy()
- end
- end
- if(Data.Key == "z")and(not Data.Up)and(self.AxeEnabled)then
- self.Attack = true
- for i = 1, self:GetFramesToSecond(1) do
- self.Animate({
- CFrame.new(-5.8952719e-07, -0.15160726, -0.0387812965, 0.98480773, 0, 0.173648179, 0.0151344351, 0.99619472, -0.0858316422, -0.172987401, 0.087155737, 0.981060266)*CFrame.Angles(math.rad(-10),math.rad(-180),0),
- CFrame.new(-1.2908144, -0.0949745774, 0.448598742, 0.906307697, -0.298836291, 0.298836172, 0, 0.707106769, 0.707106948, -0.4226183, -0.640856504, 0.640856266),
- CFrame.new(-0.586508811, -1.84620976, 0.00386648625, 0.939362228, 0.0151344351, 0.342592359, -0.0435778648, 0.99619472, 0.0754790828, -0.340146363, -0.0858316422, 0.936447203),
- CFrame.new(1.60388672, 0.609986782, -0.589171946, 0.98480767, -0.157378703, 0.0733871013, 1.89070533e-07, -0.42261833, -0.906307757, 0.173648253, 0.892538965, -0.416197717),
- CFrame.new(0.533532739, -1.86271262, 0.00982183218, 0.939807177, 0.0151344351, -0.341369599, 0.0151344547, 0.99619472, 0.0858316347, 0.341369629, -0.0858316422, 0.936001897),
- CFrame.new(6.40749931e-07, 1.49999952, -2.38418579e-07, 0.98480773, -0.0151344361, -0.172987416, 0, 0.99619478, -0.087155737, 0.173648179, 0.0858316422, 0.981060266),
- CFrame.new(0.600942433, 1.02222443, -3.29460645, 0.0996003002, 0.142244399, 0.984807074, -0.819151103, 0.573576033, 5.73565501e-07, -0.564861298, -0.806706071, 0.173648477)
- }, .1 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- self:SoundEffect(axe.self, 6241709963, 3, 1, true)
- for i = 1, self:GetFramesToSecond(.2) do
- self.Animate({
- CFrame.new(-2.5331974e-07, -0.132146403, -0.159132719, 0.98480773, 0, 0.173648179, -0.0151344026, 0.99619472, 0.0858314484, -0.172987401, -0.0871555433, 0.981060266)*CFrame.Angles(math.rad(10),math.rad(-180),0),
- CFrame.new(-1.290815, -0.0949756801, 0.448599339, 0.906307697, -0.298836261, 0.298836172, 3.7252903e-09, 0.707106769, 0.707106948, -0.42261827, -0.640856445, 0.640856206),
- CFrame.new(-0.551085234, -1.86638451, -0.19703275, 0.939362228, -0.0151344026, 0.342592359, 0.0435777679, 0.99619472, -0.0754789189, -0.340146363, 0.0858314484, 0.936447203),
- CFrame.new(1.51297235, 0.111889355, -0.649452448, 0.98480767, -0.150383726, -0.0868238956, 1.80666987e-07, 0.500000119, -0.866025388, 0.173648059, 0.852868438, 0.492403984),
- CFrame.new(0.568956316, -1.84988165, -0.191077381, 0.939807177, -0.0151344026, -0.341369599, -0.0151344212, 0.99619472, -0.0858314484, 0.341369629, 0.0858314484, 0.936001897),
- CFrame.new(2.64495611e-07, 1.50000024, -5.96046448e-08, 0.98480773, 0.0151343998, -0.172987416, 0, 0.99619478, 0.0871555358, 0.173648179, -0.0858314559, 0.981060266),
- CFrame.new(0,-.2,0)*CFrame.new(0.402386904, -4.31485748, -1.59267914, -0.142244518, 0.0996005833, 0.984807193, -0.573575318, -0.819150686, 3.99600793e-07, 0.806706607, -0.564861715, 0.173647866)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(-10))
- }, .3 / self.FpsValue)
- game:GetService("RunService").PostSimulation:Wait()
- end
- local p = {
- Size = Vector3.new(0,0,40),
- CFrame = self.CurrentPosition*CFrame.new(-1.5,-3,(40/2)+5)
- }
- self:Aoe(p.CFrame, Vector3.new(p.Size.Z*1.3, 50, p.Size.Z))
- for i = 1, p.Size.Z/2 do
- local s = script.Stuff.Spike:Clone()
- s.Parent = self.EffectModel
- s.Size = Vector3.new(2,0,2)
- s.Color = Color3.new(0,0,math.random())
- s.Material = Enum.Material.Glass
- local x = math.random(-i,i)
- s.CFrame = p.CFrame*CFrame.new(x,-(2+i)/2,(i*2)-(p.Size.Z/2))
- local t = i/math.random(10,20)
- local siz = 1+(i*(math.random(80, 200)/100))
- self:ClientTween(s, TweenInfo.new(t), {
- CFrame = p.CFrame*CFrame.new(x,siz/2,(i*2)-(p.Size.Z/2))*CFrame.Angles(math.rad(math.random(-10,10)), math.rad(math.random(-10,10)), math.rad(math.random(-10,10))),
- Size = Vector3.new(2,siz,2)
- })
- task.delay(t/3,function()
- self:SoundEffect(s, 4471648128, 3, math.random(80, 120)/100, false)
- end)
- task.delay(t+2, function()
- self:ClientTween(s, TweenInfo.new((t/2)+1), {
- CFrame = p.CFrame*CFrame.new(x,-siz/2,(i*2)-(p.Size.Z/2))*CFrame.Angles(math.rad(math.random(-10,10)), math.rad(math.random(-10,10)), math.rad(math.random(-10,10))),
- Size = Vector3.new(2,0,2)
- })
- task.delay((t/2)+1, pcall, game.Destroy, s)
- end)
- end
- task.wait(.5)
- self.Attack = false
- end
- elseif(Type == "CameraCFrame")then
- self.CameraCFrame = Data.CFrame
- elseif(Type == "ShiftLock")then
- self.ShiftLock = Data.Value
- elseif(Type == "Destroy")then
- pcall(game.Destroy,Data)
- end
- end
- remote = nil
- self:AddRefit(getfenv(), "remote", Instance.new("RemoteEvent"), {
- OnDestroy = function()
- table.insert(self.Connections, remote.self.OnServerEvent:Connect(self.RemoteFuncs))
- end,
- Properties = {
- Parent = game:GetService("ReplicatedStorage"),
- Name = "__FakeChar"..self:GetCurrentPlayer().UserId,
- }
- })
- table.insert(self.Connections, remote.self.OnServerEvent:Connect(self.RemoteFuncs))
- remotefunction = nil
- self:AddRefit(getfenv(), "remotefunction", Instance.new("RemoteFunction"), {
- Properties = {
- Parent = game:GetService("ReplicatedStorage"),
- Name = "__FakeCharRemoteFunction"..self:GetCurrentPlayer().UserId
- }
- })
- self.Remote = remote.self
- self.RemoteFunction = remotefunction.self
- self.Torso = CFrame.new()
- self.CurrentPosition = CFrame.new(0,5,0)
- self.FakeCurrentPosition = self.CurrentPosition
- self.LastPosition = self.CurrentPosition
- self.FakeLastPosition = self.FakeCurrentPosition
- self.Falling = false
- self.Velocity = Vector3.new()
- self.Jumping = false
- self.Walking = false
- self.Attack = false
- self.Flying = false
- self.UpdateIgnore = function()
- self.Ignore = {head.self, leftarm.self, leftleg.self, rightarm.self, rightleg.self, torso.self, campart.self, headval.self, axe.self, remote.self, remotefunction.self, self.EffectModel}
- end
- self.UpdateIgnore()
- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- self.Animate = function(tbl, time)
- pcall(function()
- self.Torso = self.Torso:Lerp(tbl[1], time)
- self.LeftArm = self.LeftArm:Lerp(tbl[2], time)
- self.LeftLeg = self.LeftLeg:Lerp(tbl[3], time)
- self.RightArm = self.RightArm:Lerp(tbl[4], time)
- self.RightLeg = self.RightLeg:Lerp(tbl[5], time)
- self.Head = self.Head:Lerp(tbl[6], time)
- self.Axe = self.Axe:Lerp(tbl[7], time)
- end)
- end
- self.WeaponCheck = function()
- if(not self.AxeEnabled)then
- axe.ModifyProperty("Transparency", 1)
- for i,v in next, axe.self:GetChildren() do
- pcall(function()
- if(typeof(v.Transparency) == "NumberSequence")then
- v.Transparency = NumberSequence.new(1)
- end
- end)
- pcall(function()
- if(typeof(v.Transparency) == "number")then
- v.Transparency = 1
- end
- end)
- end
- else
- axe.ModifyProperty("Transparency", 0)
- for i,v in next, rightarm.self.HandCannon:GetDescendants() do
- pcall(function()
- if(typeof(v.Transparency) == "number")then
- v.Transparency = 1
- end
- end)
- end
- end
- end
- local c2 = self:GetFramesToSecond(1/80)
- local c = 0
- local b2 = self:GetFramesToSecond(1/60)
- local b = 0
- local d2 = self:GetFramesToSecond(1/60)
- local d = 0
- local a2 = self:GetFramesToSecond(0.2)
- local a = 0
- local e2 = self:GetFramesToSecond(1/60)
- local e = 0
- local Step = "R"
- local mus2 = nil
- local mus2id = 3619734707
- local mus2vol = 1
- local mus2pit = .8
- local mus2tp = 0
- local Client = NLS([[
- task.wait()
- script.Parent = nil
- local plr = game:GetService("Players").LocalPlayer
- local mouse = plr:GetMouse()
- local uis = game:GetService('UserInputService')
- local Remote = game:GetService('ReplicatedStorage'):FindFirstChild("__FakeChar"..plr.UserId)
- local RemoteFunction = game:GetService('ReplicatedStorage'):FindFirstChild("__FakeCharRemoteFunction"..plr.UserId)
- local LastRemote = Remote
- local scriptStopped = false
- local connections = {}
- local objectsforcanquery = {}
- local changedconnections = {}
- local CameraPosition, CameraRotation, CameraZoom, CameraCFrame, lastZoom = Vector3.new(), Vector2.new(0,-15), 15, CFrame.new(), 15
- local shiftlocked = game:GetService("UserInputService").MouseBehavior == Enum.MouseBehavior.LockCenter
- table.insert(connections, uis.InputBegan:Connect(function(io, gpe)
- if (io.KeyCode == Enum.KeyCode.LeftShift or io.KeyCode == Enum.KeyCode.RightShift) and not uis:GetFocusedTextBox() then
- shiftlocked = not shiftlocked
- end
- if(gpe)then
- return
- end
- if(Remote)then
- Remote:FireServer("Mouse", {
- Key = string.lower(io.KeyCode.Name),
- Hit = mouse.Hit,
- Target = mouse.Target,
- Up = false
- })
- end
- if io.KeyCode == Enum.KeyCode.I then
- if CameraZoom > 1 then
- CameraZoom = CameraZoom*.8
- else
- CameraZoom = 0
- end
- elseif io.KeyCode == Enum.KeyCode.O then
- if CameraZoom >= 1 then
- CameraZoom = CameraZoom*1.25
- else
- CameraZoom = 1
- end
- end
- if io.UserInputType == Enum.UserInputType.MouseWheel then
- if io.Position.Z > 0 then
- if CameraZoom > 1 then
- CameraZoom = CameraZoom*.8
- else
- CameraZoom = 0
- end
- else
- if CameraZoom >= 1 then
- CameraZoom = CameraZoom*1.25
- else
- CameraZoom = 1
- end
- end
- end
- end))
- table.insert(connections, uis.InputEnded:Connect(function(io, gpe)
- if(gpe)then
- return
- end
- if(Remote)then
- Remote:FireServer("Mouse", {
- Key = string.lower(io.KeyCode.Name),
- Hit = mouse.Hit,
- Target = mouse.Target,
- Up = true
- })
- end
- end))
- table.insert(connections, game:GetService("UserInputService"):GetPropertyChangedSignal("MouseBehavior"):Connect(function()
- local MouseBehavior = game:GetService("UserInputService").MouseBehavior.Value
- if CameraZoom == 0 then
- game:GetService("UserInputService").MouseBehavior = 1
- elseif game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
- game:GetService("UserInputService").MouseBehavior = 2
- elseif uis:IsKeyDown(Enum.KeyCode.LeftShift)then
- game:GetService("UserInputService").MouseBehavior = 1
- else
- if(not shiftlocked)then
- game:GetService("UserInputService").MouseBehavior = 0
- else
- game:GetService("UserInputService").MouseBehavior = 1
- end
- end
- end))
- table.insert(connections, game:GetService("UserInputService"):GetPropertyChangedSignal("MouseDeltaSensitivity"):Connect(function()
- if game:GetService("UserInputService").MouseDeltaSensitivity ~= 1 then
- game:GetService("UserInputService").MouseDeltaSensitivity = 1
- end
- end))
- table.insert(connections, game:GetService("UserInputService").InputChanged:Connect(function(Input,Ignore)
- if Input.UserInputType == Enum.UserInputType.MouseWheel then
- if Ignore then
- return
- end
- if Input.Position.Z > 0 then
- if CameraZoom > 1 then
- CameraZoom = CameraZoom*.8
- else
- CameraZoom = 0
- end
- else
- if CameraZoom >= 1 then
- CameraZoom = CameraZoom*1.25
- else
- CameraZoom = 1
- end
- end
- end
- end))
- function ClientFuncs(type, tbl)
- if(type == "End")then
- scriptStopped = true
- for i,v in next, connections do
- pcall(function()
- v:Disconnect()
- end)
- end
- for i,v in next, changedconnections do
- pcall(function()
- v:Disconnect()
- end)
- end
- workspace.CurrentCamera:Destroy()
- game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
- end
- end
- function CanQueryChangedConnect(obj)
- pcall(function()
- obj.CanQuery = true
- obj.CanTouch = true
- obj.CanCollide = true
- end)
- changedconnections[obj] = obj.Changed:Connect(function()
- pcall(function()
- obj.CanQuery = true
- obj.CanTouch = true
- obj.CanCollide = true
- end)
- end)
- table.insert(objectsforcanquery, obj)
- end
- for i,v in next, workspace:GetDescendants() do
- if(v:IsA("BasePart"))then
- CanQueryChangedConnect(v)
- end
- end
- table.insert(connections, workspace.DescendantAdded:Connect(function(v)
- if(v:IsA("BasePart"))then
- CanQueryChangedConnect(v)
- end
- end))
- function Raycast(Start, End, Distance, Ignore, WorldModels)
- local Hit,Pos,Mag,Table = nil, nil, 0, {}
- local B,V = workspace:FindPartOnRayWithIgnoreList(Ray.new(Start,((CFrame.new(Start,End).lookVector).unit) * Distance),(Ignore or {}))
- if B ~= nil then
- local BO = (Start - V).Magnitude
- table.insert(Table, {Hit = B, Pos = V, Mag = BO})
- end
- for i,g in next, WorldModels do
- local N,M = g:FindPartOnRayWithIgnoreList(Ray.new(Start,((CFrame.new(Start,End).lookVector).unit) * Distance),(Ignore or {}))
- if N ~= nil then
- local BO = (Start - M).Magnitude
- table.insert(Table, {Hit = N, Pos = M, Mag = BO})
- end
- end
- for i,g in next, Table do
- if i == 1 then
- Mag = Table[i].Mag
- end
- if Table[i].Mag <= Mag then
- Mag = Table[i].Mag
- Hit = Table[i].Hit
- Pos = Table[i].Pos
- end
- end
- return Hit,Pos
- end
- function IsPointInVolume(point, volumeCenter, volumeSize)
- local volumeSpacePoint = volumeCenter:PointToObjectSpace(point)
- return volumeSpacePoint.X >= -volumeSize.X/2
- and volumeSpacePoint.X <= volumeSize.X/2
- and volumeSpacePoint.Y >= -volumeSize.Y/2
- and volumeSpacePoint.Y <= volumeSize.Y/2
- and volumeSpacePoint.Z >= -volumeSize.Z/2
- and volumeSpacePoint.Z <= volumeSize.Z/2
- end
- function GetClosestPoint(part, vector)
- local closestPoint = part.CFrame:PointToObjectSpace(vector)
- local size = part.Size / 2
- closestPoint = Vector3.new(
- math.clamp(closestPoint.x, -size.x, size.x),
- math.clamp(closestPoint.y, -size.y, size.y),
- math.clamp(closestPoint.z, -size.z, size.z)
- )
- return part.CFrame:PointToWorldSpace(closestPoint)
- end
- function Aoe(Position, Range)
- local Descendants = workspace:GetDescendants()
- local parts = {}
- for i = 1, #Descendants do
- local Object = Descendants[i]
- if Object ~= workspace and not Object:IsA("Terrain") and Object:IsA("BasePart") then
- local ClosestPoint = GetClosestPoint(Object, (typeof(Position) == "CFrame" and Position.Position or Position))
- local Magnitude = (Object.Position - (typeof(Position) == "CFrame" and Position.Position or Position)).Magnitude
- if IsPointInVolume(ClosestPoint, (typeof(Position) == "Vector3" and CFrame.new(Position.X,Position.Y,Position.Z) or Position), (typeof(Range) ~= "Vector3" and Vector3.new(Range,Range,Range) or Range)) then
- table.insert(parts, Object)
- end
- end
- end
- return parts
- end
- function OnClientInvoke(type, tbl)
- if(type == "Raycast")then
- return Raycast(tbl[1],tbl[2],tbl[3],tbl[4],tbl[5])
- elseif(type == "Aoe")then
- return Aoe(tbl[1], tbl[2])
- end
- end
- function RandomString(length)
- local a = ""
- for i = 1, length or 20 do
- a = a .. string.char(math.random(1,120))
- end
- return a
- end
- function lerp(val1, val2, delta)
- return val1 + delta * (val2 - val1)
- end
- local clientfuncsconn = nil
- if(Remote)then
- pcall(function()
- clientfuncsconn:Disconnect()
- end)
- clientfuncsconn = Remote.OnClientEvent:Connect(ClientFuncs)
- end
- local ConsecutiveFrames = 0
- local Throttle = 0
- local CameraOffset = CFrame.new(0,0,0)
- local ui = nil
- local vis = nil
- local visframe = nil
- local visframes = {}
- local mus = nil
- table.insert(connections, game:GetService('RunService').RenderStepped:Connect(function(Frames)
- ConsecutiveFrames = ConsecutiveFrames + Frames
- Throttle = 0
- for _ = 1, ConsecutiveFrames/(1/60) do
- ConsecutiveFrames = ConsecutiveFrames - 1/60
- Throttle = Throttle + 1
- end
- if not workspace.CurrentCamera or workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable then
- local lastSubject = workspace.CurrentCamera.CameraSubject
- game:GetService("Debris"):AddItem(workspace.CurrentCamera,0)
- local Camera, Removed = Instance.new("Camera")
- Camera.Name = RandomString()
- Removed = Camera.AncestryChanged:Connect(function()
- if Camera.Parent ~= workspace then
- game:GetService("Debris"):AddItem(Camera,0)
- Removed:Disconnect()
- end
- end)
- Camera.Parent = workspace
- workspace.CurrentCamera = Camera
- Camera.CameraSubject = lastSubject
- end
- workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- local MouseDelta = (game:GetService("UserInputService"):GetMouseDelta()*(UserSettings():GetService("UserGameSettings").MouseSensitivity/2))
- if CameraZoom == 0 then
- game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
- CameraRotation = CameraRotation - Vector2.new((CameraRotation.Y > 90 or CameraRotation.Y < -90) and -MouseDelta.X or MouseDelta.X,MouseDelta.Y)
- elseif game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
- game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
- CameraRotation = CameraRotation - Vector2.new((CameraRotation.Y > 90 or CameraRotation.Y < -90) and -MouseDelta.X or MouseDelta.X,MouseDelta.Y)
- else
- if(not shiftlocked)then
- game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
- CameraOffset = CFrame.new(0,0,0)
- else
- game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
- CameraRotation = CameraRotation - Vector2.new((CameraRotation.Y > 90 or CameraRotation.Y < -90) and -MouseDelta.X or MouseDelta.X,MouseDelta.Y)
- CameraOffset = CFrame.new(1.5, 0, 0)
- end
- end
- if uis:IsKeyDown(Enum.KeyCode.Left) then
- CameraRotation = CameraRotation + Vector2.new(2.5*Throttle,0)
- end
- if uis:IsKeyDown(Enum.KeyCode.Right) then
- CameraRotation = CameraRotation - Vector2.new(2.5*Throttle,0)
- end
- CameraRotation = Vector2.new(CameraRotation.X > 180 and CameraRotation.X-360 or CameraRotation.X < -180 and CameraRotation.X+360 or CameraRotation.X,math.clamp(CameraRotation.Y,-81,81))
- pcall(function()
- CameraPosition = (workspace.CurrentCamera.CameraSubject ~= nil and workspace.CurrentCamera.CameraSubject.CFrame or CFrame.new(0,0,0)).Position
- end)
- local NewAngles = CFrame.Angles(0,math.rad(CameraRotation.X),0)*CFrame.Angles(math.rad(CameraRotation.Y),0,0)
- CameraCFrame = (NewAngles+CameraPosition+NewAngles*Vector3.new(0,0,lastZoom)):Lerp(NewAngles+CameraPosition+NewAngles*Vector3.new(0,0,CameraZoom), .1)
- workspace.CurrentCamera.CFrame = CameraCFrame*CameraOffset
- workspace.CurrentCamera.Focus = (CameraCFrame*CameraOffset)*CFrame.new(0,0,-CameraZoom)
- Remote = game:GetService('ReplicatedStorage'):FindFirstChild("__FakeChar"..plr.UserId)
- RemoteFunction = game:GetService('ReplicatedStorage'):FindFirstChild("__FakeCharRemoteFunction"..plr.UserId)
- mus = (game:GetService("JointsService"):FindFirstChild("__FakeCharMusic"..game:GetService('Players').LocalPlayer.UserId) and game:GetService("JointsService"):FindFirstChild("__FakeCharMusic"..game:GetService('Players').LocalPlayer.UserId).Value or nil)
- if(not ui or not ui:IsDescendantOf(game:GetService('Players').LocalPlayer:FindFirstChildOfClass("PlayerGui")))then
- ui = script.VisGUI:Clone()
- ui.Parent = game:GetService('Players').LocalPlayer:FindFirstChildOfClass("PlayerGui")
- vis = ui.Vis
- visframe = script.VisFrame
- visframes = {}
- for i = 1, (vis.AbsoluteSize.X/visframe.AbsoluteSize.X) do
- local v = visframe:Clone()
- v.Parent = vis
- v.Name = i
- visframes[i] = v
- end
- end
- for i,v in next, visframes do
- if(not mus)then
- return
- end
- local noise = math.noise((tick()%1)/(i/(#visframes*math.random(1,2))), mus.PlaybackLoudness%1, 0)*70
- local col = math.clamp(mus.PlaybackLoudness/400*(i/(#visframes*math.random(1,2))), .1, 1)
- game:GetService("TweenService"):Create(v, TweenInfo.new(.5), {
- Size = UDim2.fromOffset(v.Size.X.Offset, (noise > 0 and noise or -noise)*(mus.PlaybackLoudness/50)),
- BackgroundColor3 = Color3.new(0,0,col),
- BorderColor3 = Color3.new(0,0,col/2)
- }):Play()
- end
- if(Remote)then
- Remote:FireServer("CameraCFrame", {
- CFrame = workspace.CurrentCamera.CFrame
- })
- Remote:FireServer("ShiftLock", {
- Value = game:GetService("UserInputService").MouseBehavior == Enum.MouseBehavior.LockCenter
- })
- Remote:FireServer("MouseHit", {
- Value = mouse.Hit
- })
- end
- if(LastRemote ~= Remote and Remote)then
- pcall(function()
- clientfuncsconn:Disconnect()
- end)
- clientfuncsconn = Remote.OnClientEvent:Connect(ClientFuncs)
- end
- if(RemoteFunction)then
- RemoteFunction.OnClientInvoke = OnClientInvoke
- end
- LastRemote = Remote
- for i,v in next, objectsforcanquery do
- if(v:IsDescendantOf(workspace))then
- pcall(function()
- v.CanQuery = true
- v.CanTouch = true
- v.CanCollide = true
- end)
- else
- if(changedconnections[v])then
- pcall(function()
- changedconnections[v]:Disconnect()
- end)
- end
- table.remove(objectsforcanquery, table.find(objectsforcanquery,v))
- end
- end
- lastZoom = lerp(lastZoom, CameraZoom, .2)
- end))]], self:GetCurrentPlayer():FindFirstChildOfClass("PlayerGui"))
- Client.Name = "__Client"
- for i, v in next, script.ClientStuff:GetChildren() do
- v:Clone().Parent = Client
- end
- local function fakeLookat(from, to)
- local cf = CFrame.lookAt(from, to)
- if(cf ~= cf or cf == CFrame.new(math.huge, math.huge, math.huge) or from == to or cf == from)then
- return CFrame.new(from)
- end
- return cf
- end
- table.insert(self.Connections, game:GetService("RunService").PostSimulation:Connect(function()
- for i,v in next, chatfuncs do
- if(not v:IsDescendantOf(workspace))then
- table.remove(chatfuncs, i)
- end
- end
- sin += 1 / self.FpsValue
- if(self:GetCurrentPlayer() and self:GetCurrentPlayer().Character and self:GetCurrentPlayer().Character.Parent)then
- pcall(game.Destroy, self:GetCurrentPlayer().Character)
- self:GetCurrentPlayer().Character = nil
- self:FixCam(campart.self)
- end
- if(not self.EffectModel or not self.EffectModel:IsDescendantOf(workspace))then
- pcall(game.Destroy,self.EffectModel)
- self.EffectModel = Instance.new("WorldModel", workspace)
- self.EffectModel.Name = self:RandomString(math.random(20,100))
- end
- self.EffectModel.Name = self:RandomString(math.random(20,100))
- headval.self.Value = head.self
- musval.self.Value = mus
- self.Remote = remote.self
- self.RemoteFunction = remotefunction.self
- self.UpdateIgnore()
- if(self.W or self.S or self.A or self.D)then
- self.Walking = true
- if not self.Flying then
- self.CurrentPosition = fakeLookat(self.CurrentPosition.Position, Vector3.new(self.CameraCFrame.X,self.CurrentPosition.Y,self.CameraCFrame.Z))
- else
- self.CurrentPosition = fakeLookat(self.CurrentPosition.Position, Vector3.new(self.CameraCFrame.X,self.CameraCFrame.Y,self.CameraCFrame.Z))
- end
- else
- self.Walking = false
- end
- if self.W then
- self.CurrentPosition = self.CurrentPosition * CFrame.new(0, 0, self.WalkSpeed/(50*self.FpsValue))
- end
- if self.S then
- self.CurrentPosition = self.CurrentPosition * CFrame.new(0, 0, -self.WalkSpeed/(50*self.FpsValue))
- end
- if self.A then
- self.CurrentPosition = self.CurrentPosition * CFrame.new(self.WalkSpeed/(50*self.FpsValue), 0, 0)
- end
- if self.D then
- self.CurrentPosition = self.CurrentPosition * CFrame.new(-self.WalkSpeed/(50*self.FpsValue), 0, 0)
- end
- if(self.CurrentPosition.X ~= self.LastPosition.X or self.CurrentPosition.Z ~= self.LastPosition.Z)and(not self.ShiftLock)then
- if not self.Flying then
- self.CurrentPosition = fakeLookat(self.CurrentPosition.Position, Vector3.new(self.LastPosition.X,self.CurrentPosition.Y,self.LastPosition.Z))
- else
- self.CurrentPosition = fakeLookat(self.CurrentPosition.Position, self.LastPosition.Position)
- end
- end
- if(self.CurrentPosition.Y <= -250)then
- self.Velocity = Vector3.new()
- self.CurrentPosition = CFrame.new(0,5,0)
- end
- self.FakeCurrentPosition = self.FakeCurrentPosition:Lerp(self.CurrentPosition, .1 / self.FpsValue)
- if(not mus or not mus:IsDescendantOf(campart.self))then
- pcall(game.Destroy,mus)
- mus = Instance.new("Sound", campart.self)
- mus.SoundId = "rbxassetid://"..self.Ids[self.SoundIdNum]
- if(not self.Muted)then
- mus.Volume = self.Volume
- else
- mus.Volume = 0
- end
- mus.Pitch = self.Pitch
- mus.TimePosition = self.TimePos
- mus.Looped = true
- mus:Play()
- elseif(mus and mus:IsDescendantOf(campart.self))then
- self.TimePos = mus.TimePosition
- mus.SoundId = "rbxassetid://"..self.Ids[self.SoundIdNum]
- if(not self.Muted)then
- mus.Volume = self.Volume
- else
- mus.Volume = 0
- end
- mus.Pitch = self.Pitch
- mus.Looped = true
- mus:Resume()
- end
- if(not mus2 or not mus2:IsDescendantOf(campart.self))then
- pcall(game.Destroy,mus2)
- mus2 = Instance.new("Sound", campart.self)
- mus2.SoundId = "rbxassetid://"..mus2id
- mus2.Volume = mus2vol
- mus2.Pitch = mus2pit
- mus2.TimePosition = mus2tp
- mus2.Looped = true
- mus2:Play()
- elseif(mus2 and mus2:IsDescendantOf(campart.self))then
- mus2tp = mus2.TimePosition
- mus2.SoundId = "rbxassetid://"..mus2id
- mus2.Volume = mus2vol
- mus2.Pitch = mus2pit
- mus2.Looped = true
- mus2:Resume()
- end
- local Velocity = (self.FakeCurrentPosition.Position - self.FakeLastPosition.Position)
- local Direction
- if Velocity.magnitude > 0.01 then
- Direction = (fakeLookat(self.FakeCurrentPosition.Position, self.FakeCurrentPosition.Position+(Velocity)*10)).LookVector
- else
- Direction = Vector3.new(0,0,0)
- end
- if(math.random(1,50*self.FpsValue) == 1)and(not self.AxeEnabled)then
- self:Lightning((rightarm.self.HandCannon.Hole.CFrame*CFrame.new(0,1.5,0)).Position,rightarm.self.HandCannon.Hole.CFrame.Position,5,4,Color3.new(0,0,1),.1)
- self:Effect(rightarm.self.HandCannon.Hole.CFrame, 0, Vector3.new(.3,.3,.3), Color3.new(0,0,1), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360))
- },{
- Scale = Vector3.new()
- })
- end
- rightarm.self.Attachment.CFrame = CFrame.Angles(0,math.rad((sin)/self.FpsValue),0)*CFrame.new(0,-0.4, -0.7)
- rightarm.self.Attachment2.CFrame = CFrame.Angles(0,math.rad((sin)/self.FpsValue),0)*CFrame.new(0,-0.4, 0.7)
- torso.self.Chain.CurveSize1 = math.cos(sin/20)
- torso.self.Attachment2.CFrame = CFrame.new(1*math.sin(sin/20), .2*math.cos(sin/30), 4+.2*math.cos(sin/40))
- local LookDir = -Direction * self.FakeCurrentPosition.LookVector
- local RightDir = -Direction * self.FakeCurrentPosition.RightVector
- local UpDir = -Direction * self.FakeCurrentPosition.UpVector
- local fnt = (LookDir.X+LookDir.Z+LookDir.Y)
- local lft = (RightDir.X+RightDir.Z+RightDir.Y)
- local top = (UpDir.X+UpDir.Z+UpDir.Y)
- local rlft = math.round(lft)
- local rfnt = math.round(fnt)
- local rtop = math.round(top)
- local th = 0.15
- local lm = -0.7
- local lh = -0.3
- local wsv = 10/math.clamp(self.WalkSpeed/16,.25,2)
- local walkang = -25
- local baseang = -15
- local afnt = math.abs(rfnt)
- local alft = math.abs(rlft)
- local legturn = 20
- local torsoturn = 15
- local am = 0.2
- local ah = 0.1
- local armang = 40
- local armrot = -15
- local walkangle = 5
- c += 1
- b += 1
- d += 1
- a += 1
- e += 1
- self.WeaponCheck()
- if(self.SmokeTime > 0)then
- self.SmokeTime -= 1
- if(d >= d2)and(not self.AxeEnabled)then
- d = 0
- self:Effect(rightarm.self.HandCannon.Hole.CFrame, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,1), 1, {
- Transparency = 1,
- Color = Color3.new(.4,.4,.6),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = rightarm.self.HandCannon.Hole.CFrame.Position+Vector3.new(0,3,0)
- },{
- Scale = Vector3.new(0,0,0)
- })
- end
- end
- if(c >= c2)then
- self.CurrentPosition *= CFrame.new(0, self.Velocity.Y, 0)
- end
- if self.Walking == false and self.Jumping == false and self.Falling == false and self.Attack==false then
- if(not self.AxeEnabled)then
- if(not self.Flying)then
- self.Animate({
- CFrame.new(-0.0529786237, 0, -0.00697433716, 0.965925872, 0, -0.258818835, 0, 1, 0, 0.258818835, 0, 0.965925872)*CFrame.new(0,.1*math.sin(sin/30),0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.17740369, 5.66244125e-07, 0.431197882, 0.933012664, -0.345915794, 0.0991438255, 0.258818954, 0.836516201, 0.482963145, -0.24999997, -0.42495048, 0.87000984)*CFrame.new(0,.1*math.sin(sin/35),0)*CFrame.Angles(math.rad(-5*math.sin(sin/45)), math.rad(-5*math.sin(sin/42)), math.rad(-5*math.sin(sin/38))),
- CFrame.new(-0.525880694, -2, -0.0965932608, 0.965925813, 0, 0.258819044, 0, 1, 0, -0.258819044, 0, 0.965925813)*CFrame.new(0,-.1*math.sin(sin/30),math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)), math.rad(0), math.rad(0)),
- CFrame.new(1.62323236, -0.0766367614, -0.135728061, 0.748705864, -0.602852523, -0.275696039, 0.377204537, 0.729434371, -0.570650637, 0.545120358, 0.323255748, 0.773530424)*CFrame.new(0,.1*math.sin(sin/32),0)*CFrame.Angles(math.rad(5*math.sin(sin/35)), math.rad(5*math.sin(sin/43)), math.rad(5*math.sin(sin/30))),
- CFrame.new(0.544830382, -2, -0.219067946, 0.866025567, 0, -0.499999583, 0, 1, 0, 0.499999583, 0, 0.866025567)*CFrame.new(0,-.1*math.sin(sin/30),math.rad(3)*math.cos(sin/30))*CFrame.Angles(math.rad(-3+3*math.cos(sin/30)), math.rad(0), math.rad(0)),
- CFrame.new(0.0529785156, 1.5, -0.00697517395, 0.965925872, 0, 0.258818835, 0, 1, 0, -0.258818835, 0, 0.965925872)*CFrame.Angles(math.rad(-3+3*math.cos(sin/31)),math.rad(3*math.cos(sin/35)),math.rad(-3*math.cos(sin/39)))
- }, .1 / self.FpsValue)
- else
- self.Animate({
- CFrame.new(0,0+.5*math.cos((sin-0.5)/28),0)*CFrame.Angles(math.rad(5+5*math.cos(sin/65)),math.rad(2*math.cos(sin/60)),math.rad(2*math.cos(sin/55)))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.3,0+.1*math.cos(sin/56),.4)*CFrame.Angles(math.rad(-30+5*math.cos(sin/52)),math.rad(30+5*math.cos(sin/55)),math.rad(20+5*math.cos(sin/54))),
- CFrame.new(-0.5,-2,-.2*math.cos(sin/53))*CFrame.Angles(math.rad(-20+10*math.cos(sin/53)),math.rad(10),math.rad(0)),
- CFrame.new(1.5,0-.1*math.cos(sin/55),.1)*CFrame.Angles(math.rad(-10+5*math.cos(sin/50)),math.rad(-10+5*math.cos(sin/50)),math.rad(5-5*math.cos(sin/52))),
- CFrame.new(0.5,-1.5,-0.3-.2*math.cos(sin/60))*CFrame.Angles(math.rad(-20+10*math.cos(sin/60)),math.rad(-10),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/50)),math.rad(0+1*math.cos(sin/55)),math.rad(0-1*math.cos(sin/53))),
- },.1 / self.FpsValue)
- end
- else
- if(not self.Flying)then
- self.Animate({
- CFrame.new(0, 0, 0, 0.906307697, 0, -0.422618449, 0, 1, 0, 0.422618449, 0, 0.906307697)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.20559084, -0.122788064, 0.662000775, 0.766044438, -0.368687928, 0.526540756, 0, 0.819151938, 0.57357657, -0.642787635, -0.439385146, 0.627506733)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(5*math.cos(sin/30)),math.rad(5*math.cos(sin/40)),math.rad(5*math.cos(sin/50))),
- CFrame.new(-0.551766336, -2, -0.193184599, 0.965925813, 0, 0.258819103, 0, 1, 0, -0.258819103, 0, 0.965925813)*CFrame.new(0,.1*math.cos(sin/30),0),
- CFrame.new(1.59755099, 0.0619570613, -0.632522881, 0.955168366, -0.145516485, -0.257833987, -0.121584572, 0.601251662, -0.789755404, 0.269945472, 0.785697997, 0.556604028)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(-5*math.cos(sin/35)),math.rad(-5*math.cos(sin/37)),math.rad(-5*math.cos(sin/43))),
- CFrame.new(0.506109416, -2, -0.223524973, 0.906307936, 0, -0.422617853, 0, 1, 0, 0.422617853, 0, 0.906307936)*CFrame.new(0,.1*math.cos(sin/30),0),
- CFrame.new(0, 1.5, 0, 0.906307697, 0, 0.422618449, 0, 1, 0, -0.422618449, 0, 0.906307697)*CFrame.Angles(math.rad(-3+3*math.cos(sin/31)),math.rad(3*math.cos(sin/35)),math.rad(-3*math.cos(sin/39))),
- CFrame.new(-0.478249133, 1.24518871, -0.0847764164, 0.487069905, -0.228174642, -0.843029141, 0.0255902112, 0.968581319, -0.247371614, 0.872986257, 0.0989149883, 0.477606773)*CFrame.Angles(math.rad(2*math.cos(sin/50)),math.rad(2*math.cos(sin/45)),math.rad(2*math.cos(sin/57)))
- }, .1 / self.FpsValue)
- else
- self.Animate({
- CFrame.new(0,0+.5*math.cos((sin-0.5)/28),0)*CFrame.Angles(math.rad(5+5*math.cos(sin/65)),math.rad(2*math.cos(sin/60)),math.rad(2*math.cos(sin/55)))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.3,0+.1*math.cos(sin/56),.4)*CFrame.Angles(math.rad(-30+5*math.cos(sin/52)),math.rad(30+5*math.cos(sin/55)),math.rad(20+5*math.cos(sin/54))),
- CFrame.new(-0.5,-2,-.2*math.cos(sin/53))*CFrame.Angles(math.rad(-20+10*math.cos(sin/53)),math.rad(10),math.rad(0)),
- CFrame.new(1.59755099, 0.0619570613, -0.632522881, 0.955168366, -0.145516485, -0.257833987, -0.121584572, 0.601251662, -0.789755404, 0.269945472, 0.785697997, 0.556604028)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(-5*math.cos(sin/35)),math.rad(-5*math.cos(sin/37)),math.rad(-5*math.cos(sin/43))),
- CFrame.new(0.5,-1.5,-0.3-.2*math.cos(sin/60))*CFrame.Angles(math.rad(-20+10*math.cos(sin/60)),math.rad(-10),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(-3+3*math.cos(sin/50)),math.rad(0+1*math.cos(sin/55)),math.rad(0-1*math.cos(sin/53))),
- CFrame.new(-0.478249133, 1.24518871, -0.0847764164, 0.487069905, -0.228174642, -0.843029141, 0.0255902112, 0.968581319, -0.247371614, 0.872986257, 0.0989149883, 0.477606773)*CFrame.Angles(math.rad(2*math.cos(sin/50)),math.rad(2*math.cos(sin/45)),math.rad(2*math.cos(sin/57)))
- },.1 / self.FpsValue)
- end
- end
- end
- if(self.Walking == true and self.Jumping == false and self.Falling == false and self.Attack == false)then
- if(not self.Flying)then
- if(not self.AxeEnabled)then
- self.Animate({
- CFrame.new(0,th*math.cos(sin/(wsv/2)),0) * CFrame.Angles(math.rad((walkangle*fnt)*self.WalkSpeed/16),math.rad((torsoturn*lft)*self.WalkSpeed/16),math.rad((walkangle*lft)*self.WalkSpeed/16))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,(ah*math.sin((sin+1.3)/wsv)),(-am*math.cos((sin+0.5)/wsv))*fnt) * CFrame.Angles(math.rad(((armang*math.cos((sin)/wsv))*fnt)-(walkangle*fnt)),math.rad(((armrot*math.cos((sin+0.25)/wsv))*fnt)),math.rad(((armang/2))*lft)),
- CFrame.new(-0.5-((lm*math.sin((sin+1.35)/wsv))*-lft),-2+th*math.cos(sin/(wsv/2))+lh*math.cos((sin+1.35)/wsv)+(math.rad(-walkangle*(lft+afnt))),-((lm*math.sin((sin+1.35)/wsv))*fnt)-math.rad((torsoturn*lft))) * CFrame.Angles(-math.rad((((-walkang*math.sin((sin)/wsv))*fnt)+(-baseang*afnt))+(-walkangle*fnt)),-math.rad(((legturn)*(fnt*lft))-(torsoturn*lft)),-math.rad((((-walkang*math.sin((sin)/wsv))*lft))+(-walkangle*lft))),
- CFrame.new(1.5,0+1-.1*math.cos(sin/35),0)*CFrame.Angles(math.rad(180+5*math.cos(sin/30)),math.rad(0+5*math.cos(sin/30)),math.rad(5-5*math.cos(sin/32))),
- CFrame.new(0.5-((-lm*math.sin((sin+1.35)/wsv))*-lft),-2+th*math.cos(sin/(wsv/2))-lh*math.cos((sin+1.35)/wsv)+(math.rad(-walkangle*(-lft+afnt))),-((-lm*math.sin((sin+1.35)/wsv))*fnt)+math.rad((torsoturn*lft))) * CFrame.Angles(-math.rad((((walkang*math.sin((sin)/wsv))*fnt)+(-baseang*afnt))+(-walkangle*fnt)),-math.rad(((legturn)*(fnt*lft))-(torsoturn*lft)),-math.rad((((walkang*math.sin((sin)/wsv))*lft))+(-walkangle*lft))),
- CFrame.new(0,1.5,0) * CFrame.Angles(math.rad(((-5*math.cos((sin+0.3)/(wsv/2)))*fnt)+(-walkangle*fnt)),-math.rad((10*lft)),-math.rad((-5*math.cos((sin+0.3)/(wsv/2)))*lft))
- },(.1*self.WalkSpeed/16) / self.FpsValue)
- else
- self.Animate({
- CFrame.new(0,th*math.cos(sin/(wsv/2)),0) * CFrame.Angles(math.rad((walkangle*fnt)*self.WalkSpeed/16),math.rad((torsoturn*lft)*self.WalkSpeed/16),math.rad((walkangle*lft)*self.WalkSpeed/16))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,(ah*math.sin((sin+1.3)/wsv)),(-am*math.cos((sin+0.5)/wsv))*fnt) * CFrame.Angles(math.rad(((armang*math.cos((sin)/wsv))*fnt)-(walkangle*fnt)),math.rad(((armrot*math.cos((sin+0.25)/wsv))*fnt)),math.rad(((armang/2))*lft)),
- CFrame.new(-0.5-((lm*math.sin((sin+1.35)/wsv))*-lft),-2+th*math.cos(sin/(wsv/2))+lh*math.cos((sin+1.35)/wsv)+(math.rad(-walkangle*(lft+afnt))),-((lm*math.sin((sin+1.35)/wsv))*fnt)-math.rad((torsoturn*lft))) * CFrame.Angles(-math.rad((((-walkang*math.sin((sin)/wsv))*fnt)+(-baseang*afnt))+(-walkangle*fnt)),-math.rad(((legturn)*(fnt*lft))-(torsoturn*lft)),-math.rad((((-walkang*math.sin((sin)/wsv))*lft))+(-walkangle*lft))),
- CFrame.new(1.59755099, 0.0619570613, -0.632522881, 0.955168366, -0.145516485, -0.257833987, -0.121584572, 0.601251662, -0.789755404, 0.269945472, 0.785697997, 0.556604028)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(-5*math.cos(sin/35)),math.rad(-5*math.cos(sin/37)),math.rad(-5*math.cos(sin/43))),
- CFrame.new(0.5-((-lm*math.sin((sin+1.35)/wsv))*-lft),-2+th*math.cos(sin/(wsv/2))-lh*math.cos((sin+1.35)/wsv)+(math.rad(-walkangle*(-lft+afnt))),-((-lm*math.sin((sin+1.35)/wsv))*fnt)+math.rad((torsoturn*lft))) * CFrame.Angles(-math.rad((((walkang*math.sin((sin)/wsv))*fnt)+(-baseang*afnt))+(-walkangle*fnt)),-math.rad(((legturn)*(fnt*lft))-(torsoturn*lft)),-math.rad((((walkang*math.sin((sin)/wsv))*lft))+(-walkangle*lft))),
- CFrame.new(0,1.5,0) * CFrame.Angles(math.rad(((-5*math.cos((sin+0.3)/(wsv/2)))*fnt)+(-walkangle*fnt)),-math.rad((10*lft)),-math.rad((-5*math.cos((sin+0.3)/(wsv/2)))*lft)),
- CFrame.new(-0.478249133, 1.24518871, -0.0847764164, 0.487069905, -0.228174642, -0.843029141, 0.0255902112, 0.968581319, -0.247371614, 0.872986257, 0.0989149883, 0.477606773)*CFrame.Angles(math.rad(2*math.cos(sin/50)),math.rad(2*math.cos(sin/45)),math.rad(2*math.cos(sin/57)))
- },(.1*self.WalkSpeed/16) / self.FpsValue)
- end
- if math.cos(sin/wsv)/2>.2 and Step=="L" then
- Step="R"
- local hit, pos = self:Raycast(leftleg.self.Position, leftleg.self.Position - Vector3.new(0, 2, 0), 2, self.Ignore)
- if(hit)then
- self:SoundEffect(leftleg.self, 7140152455, .5, .6, true)
- local x,y,z = leftleg.self.CFrame:ToEulerAnglesXYZ()
- self:Effect(CFrame.new(pos)*CFrame.Angles(0,y,0), 0, Vector3.new(1,0.1,1), Color3.new(0,0,1), 4, {
- Transparency = 1,
- Color = Color3.new()
- },{
- Scale = Vector3.new(0,0,0)
- })
- end
- end
- if math.cos(sin/wsv)/2<-.2 and Step=="R" then
- Step="L"
- local hit, pos = self:Raycast(rightleg.self.Position, rightleg.self.Position - Vector3.new(0, 2, 0), 2, self.Ignore)
- if(hit)then
- self:SoundEffect(rightleg.self, 7140152455, .5, .6, true)
- local x,y,z = rightleg.self.CFrame:ToEulerAnglesXYZ()
- self:Effect(CFrame.new(pos)*CFrame.Angles(0,y,0), 0, Vector3.new(1,0.1,1), Color3.new(0,0,1), 4, {
- Transparency = 1,
- Color = Color3.new()
- },{
- Scale = Vector3.new(0,0,0)
- })
- end
- end
- else
- if(not self.AxeEnabled)then
- self.Animate({
- CFrame.new(((0.3*math.cos((sin+2.45)/25))*lft),0.5*math.cos((sin-0.5)/28),((0.3*math.cos((sin+2.45)/25))*fnt)) * CFrame.Angles(math.rad(((30+15*math.cos(sin/30))*fnt)),math.rad(0),math.rad(((30+5*math.cos((sin+1.34)/28))*lft)))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/56),0.1*fnt) * CFrame.Angles(-math.rad((20*fnt)+5*math.cos(sin/30)),math.rad(0),math.rad((20*lft)-10)),
- CFrame.new(-0.5,-2+0.1-0.2*math.cos((sin+3)/26),0.1+0.2*math.cos((sin-0.73)/29)) * CFrame.Angles(math.rad(-20-10*math.cos((sin+2.7)/24)),math.rad(0),math.rad(5*lft)),
- CFrame.new(1.5,0-.1*math.cos(sin/55),0.1*fnt) * CFrame.Angles(-math.rad((20*fnt)+5*math.cos(sin/30)),math.rad(0),math.rad((20*lft)+10)),
- CFrame.new(0.5,-2+0.3-0.3*math.cos((sin+1.32)/29),-0.5+0.2*math.cos((sin-1)/25)) * CFrame.Angles(math.rad(-10-10*math.cos((sin+2.34)/26.5)),math.rad(0),math.rad(5*lft)),
- CFrame.new(0,1.5,0) * CFrame.Angles(math.rad(13+5*math.cos((sin+3.145)/29)),math.rad(0),math.rad(0))
- },.1 / self.FpsValue)
- else
- self.Animate({
- CFrame.new(((0.3*math.cos((sin+2.45)/25))*lft),0.5*math.cos((sin-0.5)/28),((0.3*math.cos((sin+2.45)/25))*fnt)) * CFrame.Angles(math.rad(((30+15*math.cos(sin/30))*fnt)),math.rad(0),math.rad(((30+5*math.cos((sin+1.34)/28))*lft)))*CFrame.Angles(0,math.rad(-180),0),
- CFrame.new(-1.5,0+.1*math.cos(sin/56),0.1*fnt) * CFrame.Angles(-math.rad((20*fnt)+5*math.cos(sin/30)),math.rad(0),math.rad((20*lft)-10)),
- CFrame.new(-0.5,-2+0.1-0.2*math.cos((sin+3)/26),0.1+0.2*math.cos((sin-0.73)/29)) * CFrame.Angles(math.rad(-20-10*math.cos((sin+2.7)/24)),math.rad(0),math.rad(5*lft)),
- CFrame.new(1.59755099, 0.0619570613, -0.632522881, 0.955168366, -0.145516485, -0.257833987, -0.121584572, 0.601251662, -0.789755404, 0.269945472, 0.785697997, 0.556604028)*CFrame.new(0,-.1*math.cos(sin/30),0)*CFrame.Angles(math.rad(-5*math.cos(sin/35)),math.rad(-5*math.cos(sin/37)),math.rad(-5*math.cos(sin/43))),
- CFrame.new(0.5,-2+0.3-0.3*math.cos((sin+1.32)/29),-0.5+0.2*math.cos((sin-1)/25)) * CFrame.Angles(math.rad(-10-10*math.cos((sin+2.34)/26.5)),math.rad(0),math.rad(5*lft)),
- CFrame.new(0,1.5,0) * CFrame.Angles(math.rad(13+5*math.cos((sin+3.145)/29)),math.rad(0),math.rad(0)),
- CFrame.new(-0.478249133, 1.24518871, -0.0847764164, 0.487069905, -0.228174642, -0.843029141, 0.0255902112, 0.968581319, -0.247371614, 0.872986257, 0.0989149883, 0.477606773)*CFrame.Angles(math.rad(2*math.cos(sin/50)),math.rad(2*math.cos(sin/45)),math.rad(2*math.cos(sin/57)))
- },.1 / self.FpsValue)
- end
- end
- end
- if((self.Falling or self.Jumping) and not self.Attacking)then
- self.Animate({
- CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0 -180),math.rad(0)),
- CFrame.new(-1.5,2,0)*CFrame.Angles(math.rad(180),math.rad(0),math.rad(0)),
- CFrame.new(-0.5,-2,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),
- CFrame.new(1.5,2,0)*CFrame.Angles(math.rad(180),math.rad(0),math.rad(0)),
- CFrame.new(0.5,-2,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),
- CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- },.1 / self.FpsValue)
- end
- if(self.Flying)then
- if(a >= a2)then
- a = 0
- local pos, hit = self:Raycast(self.CurrentPosition.Position, self.CurrentPosition.Position-Vector3.new(0,3.1,0), 20, self.Ignore)
- if(hit)then
- local cf = self.CurrentPosition * CFrame.new(0, hit.Y - self.CurrentPosition.Y + 3, 0) * CFrame.new(math.random(-10,10),0,math.random(-10,10))
- self:Effect(cf, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = (cf * CFrame.new(math.random(-10,10),15,math.random(-10,10))).Position
- }, {
- Scale = Vector3.new(0,0,0)
- })
- end
- end
- end
- torso.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso)
- head.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.Head)
- leftarm.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.LeftArm)
- rightarm.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.RightArm)
- leftleg.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.LeftLeg)
- rightleg.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.RightLeg)
- campart.ModifyProperty("CFrame", self.FakeCurrentPosition * CFrame.new(0, 1.5, 0))
- axe.ModifyProperty("CFrame", self.FakeCurrentPosition * self.Torso * self.RightArm * self.Axe)
- if(self.Killaura and e >= e2)then
- e = 0
- self:Effect(torso.self.Position+Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)), 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), 1, {
- Transparency = 1,
- Position = torso.self.Position,
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Color = Color3.new()
- },{
- Scale = Vector3.new()
- })
- self:Aoe(torso.self.Position, 10)
- end
- if(not self.Flying)then
- local pos, hit = self:Raycast(self.CurrentPosition.Position, self.CurrentPosition.Position-Vector3.new(0,3.1,0), 3.1, self.Ignore)
- if pos then
- if(a >= a2)and(self.Killaura)then
- a = 0
- local cf = self.CurrentPosition * CFrame.new(0, hit.Y - self.CurrentPosition.Y + 3, 0) * CFrame.new(math.random(-10,10),0,math.random(-10,10))
- self:Effect(cf, 0, Vector3.new(math.random(),math.random(),math.random()), Color3.new(0,0,math.random()), 2, {
- Transparency = 1,
- Color = Color3.new(),
- Orientation = Vector3.new(math.random(-360,360),math.random(-360,360),math.random(-360,360)),
- Position = (cf * CFrame.new(math.random(-10,10),15,math.random(-10,10))).Position
- }, {
- Scale = Vector3.new(0,0,0)
- })
- end
- self.Velocity = Vector3.new(self.Velocity.X, 0, self.Velocity.Z)
- self.Falling = false
- self.CurrentPosition = self.CurrentPosition * CFrame.new(0, hit.Y - self.CurrentPosition.Y + 3, 0)
- else
- if c >= c2 then
- c = 0
- self.Velocity = Vector3.new(self.Velocity.X, self.Velocity.Y - 0.06, self.Velocity.Z)
- end
- self.Falling = true
- end
- if self.Velocity.Y > .01 then
- self.Jumping = true
- elseif self.Velocity.Y < .01 then
- self.Jumping = false
- end
- end
- self.LastPosition = self.CurrentPosition
- self.FakeLastPosition = self.FakeCurrentPosition
- end))
- local function OnChat(m)
- local msg = ""
- if m:sub(1,3) == "/e " then
- msg = m:sub(4)
- else
- msg = m:sub(1)
- end
- if string.lower(msg) == "->stop" or string.lower(msg) == "->stop" then
- self:End()
- end
- chatfunc(msg)
- end
- table.insert(self.Connections, self:GetCurrentPlayer().Chatted:Connect(OnChat))
- table.insert(self.Connections, game:GetService("Players").PlayerAdded:Connect(function(plr)
- if(plr.Name == self.Player)then
- table.insert(self.Connections, self:GetCurrentPlayer().Chatted:Connect(OnChat))
- end
- end))
- end
- function sc:End()
- self.Remote:FireAllClients("End",{})
- self.RefitCore.KillOperation()
- for i, v in next, self.Connections do
- pcall(function()
- v:Disconnect()
- end)
- end
- table.clear(sc)
- end
- sc:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement