Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- local num = 0
- local p = game.Players.LocalPlayer
- local char = p.Character
- local rad = math.rad
- local hum = char.Humanoid
- local LeftUpperArm = char.LeftUpperArm
- local LeftShoulder = char.LeftUpperArm.LeftShoulder
- local LeftLowerArm = char.LeftLowerArm
- local LeftElbow = char.LeftLowerArm.LeftElbow
- local LeftUpperLeg = char.LeftUpperLeg
- local LeftHip = char.LeftUpperLeg.LeftHip
- local LeftLowerLeg = char.LeftLowerLeg
- local LeftKnee = char.LeftLowerLeg.LeftKnee
- local RightUpperArm = char.RightUpperArm
- local RightShoulder = char.RightUpperArm.RightShoulder
- local RightLowerArm = char.RightLowerArm
- local RightElbow = char.RightLowerArm.RightElbow
- local RightUpperLeg = char.RightUpperLeg
- local RightHip = char.RightUpperLeg.RightHip
- local RightLowerLeg = char.RightLowerLeg
- local RightKnee = char.RightLowerLeg.RightKnee
- local UpperTorso = char.UpperTorso
- local LowerTorso = char.LowerTorso
- local Root = char.LowerTorso.Root
- local Head = char.Head
- local Neck = char.Head.Neck
- local RootPart = char.HumanoidRootPart
- local LeftHand = char.LeftHand
- local RightHand = char.RightHand
- local LeftFoot = char.LeftFoot
- local RightFoot = char.RightFoot
- Instance.new("ForceField", char).Visible = false
- hum:SetStateEnabled("Dead", false)
- hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
- local candie = false
- local Udyne = true
- local v3 = Vector3.new
- local idle = true
- local walk = true
- local debounce = true
- local mouse = p:GetMouse()
- local walk1 = true
- local walkon = true
- local ns = NumberSequence.new
- local new = Instance.new
- local nr = NumberRange.new
- local bc = BrickColor.new
- local UpperTorso = char.UpperTorso
- local Waist = char.UpperTorso.Waist
- local srot = 0
- local spos = {
- [1] = {180},
- [2] = {144},
- [3] = {108},
- [4] = {72},
- [5] = {36},
- [6] = {0}
- }
- local Vetrom = new("Sound", char)
- Vetrom.SoundId = "rbxassetid://682726290"
- Vetrom.Volume = 5
- Vetrom.Pitch = 1
- Vetrom.Looped = true
- Vetrom:Play()
- local hitsnd = new("Sound", char)
- hitsnd.SoundId = "rbxassetid://410625063"
- hitsnd.Volume = 10
- hitsnd.Pitch = 1
- for i = 1, 20 do
- LeftShoulder.C0 = LeftShoulder.C0:lerp(CFrame.new(LeftShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightShoulder.C0 = RightShoulder.C0:lerp(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(rad(120), rad(0), rad(0)), 0.1)
- LeftElbow.C0 = LeftElbow.C0:lerp(CFrame.new(LeftElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightElbow.C0 = RightElbow.C0:lerp(CFrame.new(RightElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftHip.C0 = LeftHip.C0:lerp(CFrame.new(LeftHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightHip.C0 = RightHip.C0:lerp(CFrame.new(RightHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftKnee.C0 = LeftKnee.C0:lerp(CFrame.new(LeftKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightKnee.C0 = RightKnee.C0:lerp(CFrame.new(RightKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Root.C0 = Root.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Neck.C0 = Neck.C0:lerp(CFrame.new(Neck.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightFoot.RightAnkle.C0 = RightFoot.RightAnkle.C0:lerp(CFrame.new(RightFoot.RightAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftFoot.LeftAnkle.C0 = LeftFoot.LeftAnkle.C0:lerp(CFrame.new(LeftFoot.LeftAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightHand.RightWrist.C0 = RightHand.RightWrist.C0:lerp(CFrame.new(RightHand.RightWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftHand.LeftWrist.C0 = LeftHand.LeftWrist.C0:lerp(CFrame.new(LeftHand.LeftWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Waist.C0 = Waist.C0:lerp(CFrame.new(Waist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- wait()
- end
- wait(0.5)
- for i = 1, 20 do
- LeftShoulder.C0 = LeftShoulder.C0:lerp(CFrame.new(LeftShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightShoulder.C0 = RightShoulder.C0:lerp(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftElbow.C0 = LeftElbow.C0:lerp(CFrame.new(LeftElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightElbow.C0 = RightElbow.C0:lerp(CFrame.new(RightElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftHip.C0 = LeftHip.C0:lerp(CFrame.new(LeftHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightHip.C0 = RightHip.C0:lerp(CFrame.new(RightHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftKnee.C0 = LeftKnee.C0:lerp(CFrame.new(LeftKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightKnee.C0 = RightKnee.C0:lerp(CFrame.new(RightKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Root.C0 = Root.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Neck.C0 = Neck.C0:lerp(CFrame.new(Neck.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightFoot.RightAnkle.C0 = RightFoot.RightAnkle.C0:lerp(CFrame.new(RightFoot.RightAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftFoot.LeftAnkle.C0 = LeftFoot.LeftAnkle.C0:lerp(CFrame.new(LeftFoot.LeftAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- RightHand.RightWrist.C0 = RightHand.RightWrist.C0:lerp(CFrame.new(RightHand.RightWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- LeftHand.LeftWrist.C0 = LeftHand.LeftWrist.C0:lerp(CFrame.new(LeftHand.LeftWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- Waist.C0 = Waist.C0:lerp(CFrame.new(Waist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1)
- wait()
- end
- local udynespear1 = new("Part", char)
- udynespear1.BrickColor = bc("Toothpaste")
- udynespear1.Material = "Neon"
- udynespear1.CanCollide = false
- udynespear1.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 10, 0)
- udynespear1.Size = Vector3.new(1, 1, 1)
- local udynespear2 = new("Part", char)
- udynespear2.BrickColor = udynespear1.BrickColor
- udynespear2.Material = udynespear1.Material
- udynespear2.CanCollide = false
- udynespear2.CFrame = udynespear1.CFrame
- udynespear2.Size = udynespear1.Size
- local udynespear3 = new("Part", char)
- udynespear3.BrickColor = udynespear1.BrickColor
- udynespear3.Material = udynespear1.Material
- udynespear3.CanCollide = false
- udynespear3.CFrame = udynespear1.CFrame
- udynespear3.Size = udynespear1.Size
- local udynespear4 = new("Part", char)
- udynespear4.BrickColor = udynespear1.BrickColor
- udynespear4.Material = udynespear1.Material
- udynespear4.CanCollide = false
- udynespear4.CFrame = udynespear1.CFrame
- udynespear4.Size = udynespear1.Size
- local udynespear5 = new("Part", char)
- udynespear5.BrickColor = udynespear1.BrickColor
- udynespear5.Material = udynespear1.Material
- udynespear5.CanCollide = false
- udynespear5.CFrame = udynespear1.CFrame
- udynespear5.Size = udynespear1.Size
- local udynespear6 = new("Part", char)
- udynespear6.BrickColor = udynespear1.BrickColor
- udynespear6.Material = udynespear1.Material
- udynespear6.CanCollide = false
- udynespear6.CFrame = udynespear1.CFrame
- udynespear6.Size = udynespear1.Size
- local zxc = Instance.new("SpecialMesh", udynespear1)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local zxc = Instance.new("SpecialMesh", udynespear2)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local zxc = Instance.new("SpecialMesh", udynespear3)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local zxc = Instance.new("SpecialMesh", udynespear4)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local zxc = Instance.new("SpecialMesh", udynespear5)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local zxc = Instance.new("SpecialMesh", udynespear6)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(3, 3, 3)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- local sbg6 = Instance.new("BodyGyro", udynespear6)
- sbg6.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg6.D = 400
- BP6 = Instance.new("BodyPosition", udynespear6)
- local sbg5 = Instance.new("BodyGyro", udynespear5)
- sbg5.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg5.D = 400
- BP5 = Instance.new("BodyPosition", udynespear5)
- local sbg4 = Instance.new("BodyGyro", udynespear4)
- sbg4.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg4.D = 400
- BP4 = Instance.new("BodyPosition", udynespear4)
- local sbg3 = Instance.new("BodyGyro", udynespear3)
- sbg3.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg3.D = 400
- BP3 = Instance.new("BodyPosition", udynespear3)
- local sbg2 = Instance.new("BodyGyro", udynespear2)
- sbg2.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg2.D = 400
- BP2 = Instance.new("BodyPosition", udynespear2)
- local sbg = Instance.new("BodyGyro", udynespear1)
- sbg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg.D = 400
- BP = Instance.new("BodyPosition", udynespear1)
- spawn(function()
- while Udyne == true do
- BP2.Position = char.HumanoidRootPart.CFrame * CFrame.new(10, 5, 0).p
- BP3.Position = char.HumanoidRootPart.CFrame * CFrame.new(6, 8, 0).p
- BP.Position = char.HumanoidRootPart.CFrame * CFrame.new(3, 10, 0).p
- BP4.Position = char.HumanoidRootPart.CFrame * CFrame.new(-6, 8, 0).p
- BP5.Position = char.HumanoidRootPart.CFrame * CFrame.new(-3, 10, 0).p
- BP6.Position = char.HumanoidRootPart.CFrame * CFrame.new(-10, 5, 0).p
- sbg6.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg5.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg4.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg3.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg2.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- srot = srot + 4
- if srot == 360 then
- srot = 0
- end
- wait()
- end
- end)
- local Light = Instance.new("PointLight", char.HumanoidRootPart)
- Light.Color = Color3.new(0, 0, 1)
- Light.Brightness = 100
- Light.Range = 10
- hdebounce = true
- function throw1spear()
- coroutine.resume(coroutine.create(function()
- local udynespeart = new("Part", char)
- local zxc = Instance.new("SpecialMesh", udynespeart)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(2, 2, 2)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- udynespeart.BrickColor = udynespear1.BrickColor
- udynespeart.Material = udynespear1.Material
- udynespeart.CanCollide = false
- udynespeart.Anchored = false
- udynespeart.Size = Vector3.new(2, 2, 2)
- udynespeart.CFrame = (char.HumanoidRootPart.CFrame + Vector3.new(math.random(1, 2), 0, 2)) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(0)), math.random(0, math.rad(0)), math.random(0, math.rad(0)))
- udynespeart.Touched:connect(function(hit)
- if hit.Parent == char then
- return
- end
- for i, v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") and hdebounce == true then
- hdebounce = false
- v.Health = v.Health - 10
- wait(0.9)
- hdebounce = true
- end
- end
- end)
- local sbgt = Instance.new("BodyGyro", udynespeart)
- sbgt.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbgt.D = 400
- sbgt.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- BPt = Instance.new("BodyPosition", udynespeart)
- BPt.Position = udynespeart.CFrame * CFrame.new(0, 10, 0).p
- wait(1)
- udynespeart.Anchored = true
- wait(0.5)
- udynespeart.Anchored = false
- BPt:destroy()
- local BodyVelocity = Instance.new("BodyVelocity", udynespeart)
- BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- BodyVelocity.velocity = mouse.Hit.lookVector * 200
- for i = 1, 5 do
- sbgt.CFrame = CFrame.new(udynespeart.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- wait()
- end
- sbgt:destroy()
- end))
- end
- mouse.KeyDown:connect(function(k)
- if k == "e" then
- end
- end)
- mouse.KeyDown:connect(function(k)
- if k == "f" then
- throw1spear()
- end
- end)
- local hitt
- mouse.KeyDown:connect(function(k)
- if k == "q" and mouse.Target then
- if mouse.Target.Parent == char then
- return
- end
- if mouse.Target.Parent == game.workspace.Base then
- return
- end
- for i, v in pairs(mouse.Target.Parent:GetChildren()) do
- if v:IsA("Humanoid") then
- hitt = mouse.Target.Parent
- if debounce == true then
- debounce = false
- for i = 1, 2 do
- do
- local speara = new("Part", char)
- speara.Touched:connect(function(hit)
- if hit.Parent == char then
- return
- end
- for i, v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") and hdebounce == true then
- hdebounce = false
- v.Health = v.Health - 10
- wait(0.9)
- hdebounce = true
- end
- end
- end)
- local gunlight = Instance.new("SpotLight", speara)
- gunlight.Range = 40
- gunlight.Angle = 60
- gunlight.Face = "Top"
- gunlight.Shadows = true
- gunlight.Enabled = true
- gunlight.Color = Color3.new(0, 0, 1)
- local gunlight2 = Instance.new("SpotLight", speara)
- gunlight2.Range = 40
- gunlight2.Angle = 60
- gunlight2.Face = "Top"
- gunlight2.Shadows = true
- gunlight2.Enabled = true
- gunlight2.Color = Color3.new(0, 0, 1)
- speara.Size = Vector3.new(2, 2, 2)
- speara.BrickColor = bc("Toothpaste")
- local zxc = Instance.new("SpecialMesh", speara)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(2, 2, 2)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- speara.Transparency = 0
- speara.Anchored = false
- speara.CanCollide = false
- speara.Name = "Spear"
- speara.CFrame = (mouse.Hit + Vector3.new(math.random(-10, 10), 19, math.random(-10, 10))) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(359)), math.random(0, math.rad(359)), math.random(0, math.rad(359)))
- local sbgta = Instance.new("BodyGyro", speara)
- sbgta.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbgta.D = 10
- BPta = Instance.new("BodyPosition", speara)
- BPta.Name = "shootP"
- BPta.P = 20000
- sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- BPta.Position = speara.CFrame * CFrame.new(0, 2, 0).p
- wait(0.9)
- sbgta.D = 500
- wait(1)
- BPta.D = 1000
- BPta.Position = hitt.HumanoidRootPart.CFrame * CFrame.new(0, -3, 0).p
- sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- debounce = true
- local gdisp = coroutine.wrap(function()
- wait(1)
- for i = 1, 9 do
- wait(0.1)
- speara.Transparency = speara.Transparency + 0.3
- end
- speara:Destroy()
- end)
- gdisp()
- end
- end
- end
- end
- end
- end
- end)
- health = hum.Health
- hum.Changed:connect(function()
- if hum.Health < 5 and candie == false then
- candie = true
- defeated()
- end
- health = hum.Health
- end)
- p.Character.Humanoid.Died:connect(function()
- local jkl = Instance.new("Sound", Workspace)
- jkl.SoundId = "rbxassetid://427025525"
- jkl.Volume = 10
- jkl:Play()
- for _, V in pairs(char:getChildren()) do
- if V:isA("BasePart") then
- V.Transparency = 1
- elseif V:IsA("Accessory") and V:FindFirstChild("Handle") then
- V.Handle.Transparency = 1
- end
- end
- char.Head.face:destroy()
- for i = 1, 50 do
- dust = Instance.new("Part")
- dust.Locked = true
- dust.Size = Vector3.new(0.1, 0.1, 0.1)
- dust.BrickColor = BrickColor.new("White")
- dust.Transparency = 0
- dust.TopSurface = "Smooth"
- dust.BottomSurface = "Smooth"
- dust.CFrame = char.HumanoidRootPart.CFrame
- dust.CanCollide = true
- dust.Reflectance = 0.1
- dust.Material = "Neon"
- dust.Parent = char
- dust.Anchored = false
- end
- end)
Add Comment
Please, Sign In to add comment