Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end local plr = game:service'Players'.LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local humanoid = char:findFirstChild("Humanoid")
- local torso = char:findFirstChild("Torso")
- local head = char.Head
- local ra = char:findFirstChild("Right Arm")
- local la = char:findFirstChild("Left Arm")
- local rl = char:findFirstChild("Right Leg")
- local ll = char:findFirstChild("Left Leg")
- local rs = torso:findFirstChild("Right Shoulder")
- local ls = torso:findFirstChild("Left Shoulder")
- local rh = torso:findFirstChild("Right Hip")
- local lh = torso:findFirstChild("Left Hip")
- local neck = torso:findFirstChild("Neck")
- local cam = workspace.CurrentCamera
- OVERPowered = false
- local spear = Instance.new("Model", char)
- spear.Name = "Spear"
- local BG = Instance.new("BodyGyro")
- BG.maxTorque = Vector3.new(0, 20e+763, 0)
- BG.P = 20e+003
- BG.D = 100
- local handle = Instance.new("Part", spear)
- handle.formFactor = "Custom"
- handle.Size = Vector3.new(0.2, 0.2, 4)
- handle.BrickColor = BrickColor.new("Brown")
- handle:BreakJoints()
- Instance.new("SpecialMesh", handle).MeshId = "http://www.roblox.com/asset/?id=43645078"
- handle.Mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- local weld = Instance.new("Weld", handle)
- weld.C0 = CFrame.new(0, 0.95, 0) * CFrame.Angles(0, 0, 0)
- weld.Part0 = handle
- weld.Part1 = ra
- function animate()
- BGcframestored = mouse.Hit
- BG.Parent = torso
- coroutine.wrap(function()
- for i = 0, 70, 10 do
- neck.C0 = neck.C0 * CFrame.Angles(0, 0, math.rad(10))
- BG.cframe = BGcframestored * CFrame.Angles(0, -math.rad(i), 0)
- wait()
- end
- end)()
- rs.Parent = nil
- local ar = Instance.new("Part", spear)
- ar.FormFactor = "Custom"
- ar.Size = Vector3.new(1, 1, 1)
- ar.Transparency = 1
- ar.CanCollide = false
- ar.Locked = true
- ar:BreakJoints()
- local weld = Instance.new("Weld", ar)
- weld.C0 = CFrame.new(0, 0.5, 0)
- weld.Part0 = ra
- weld.Part1 = ar
- local motor = Instance.new("Motor", spear)
- motor.Part0 = torso
- motor.Part1 = ar
- motor.C0 = CFrame.new(1.5, 0.5, 0)
- for angle = 0, 180, 20 do
- motor.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(angle), -math.rad(60), 0)
- game:service'RunService'.Stepped:wait()
- end
- coroutine.wrap(function()
- for angle = 180, 0, -20 do
- motor.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(angle), -math.rad(angle/3), 0)
- game:service'RunService'.Stepped:wait()
- end
- end)()
- coroutine.wrap(function()
- wait(0.1)
- for i = 70, 0, -10 do
- neck.C0 = neck.C0 * CFrame.Angles(0, 0, -math.rad(10))
- BG.cframe = BGcframestored * CFrame.Angles(0, -math.rad(i), 0)
- wait()
- end
- wait(0.4)
- motor:Destroy()
- BG.Parent = nil
- rs.Parent = torso
- ar:Destroy()
- end)()
- end
- --billboardGui func
- function billboardGui(msg, objvar)
- coroutine.wrap(function()
- local prt = Instance.new("Part", char)
- prt.FormFactor = "Custom"
- prt.Size = Vector3.new(0.1, 0.1, 0.1)
- prt.Transparency = 1
- prt.CanCollide = false
- prt.CFrame = CFrame.new(objvar.CFrame.x, objvar.CFrame.y, objvar.CFrame.z)
- prt.Anchored = true
- local bg = Instance.new("BillboardGui")
- bg.Parent = prt
- bg.Adornee = prt
- bg.Size = UDim2.new(4, 0, 3.5, 0)
- bg.ExtentsOffset = Vector3.new(0, 0, 0)
- local lol = Instance.new("TextLabel")
- lol.Size = UDim2.new(1.3, 0, 0.4, 0)
- lol.TextScaled = true
- lol.TextWrapped = true
- lol.BackgroundTransparency = 1
- lol.Parent = bg
- lol.FontSize = "Size24"
- lol.TextColor3 = Color3.new(1, 0, 0)
- lol.TextStrokeTransparency = 0
- lol.Font = "ArialBold"
- lol.Text = (msg)
- for _ = 2, 15, 1 do
- if prt == nil then return end
- prt.CFrame = prt.CFrame * CFrame.new(0, 0.2, 0)
- game:service'RunService'.Stepped:wait()
- end
- for _ = 0, 10 do
- lol.TextStrokeTransparency = lol.TextStrokeTransparency + 0.1
- lol.TextTransparency = lol.TextTransparency + 0.1
- wait()
- end
- prt:Destroy()
- end)()
- end
- --ray func
- function rayCast(speed, gravity)
- coroutine.wrap(function()
- local rayPart = Instance.new("Part")
- rayPart.Name = "RayPart"
- rayPart.BrickColor = BrickColor.new("Brown")
- rayPart.Anchored = true
- rayPart.CanCollide = false
- rayPart.Locked = true
- rayPart.TopSurface = Enum.SurfaceType.Smooth
- rayPart.BottomSurface = Enum.SurfaceType.Smooth
- rayPart.formFactor = Enum.FormFactor.Custom
- rayPart.Size = Vector3.new(0.2, 0.2, 3)
- Instance.new("SpecialMesh", rayPart).MeshId = "http://www.roblox.com/asset/?id=43645078"
- rayPart.Mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- local bulletposition = handle.Position + Vector3.new(0, 0, 0)
- local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-1,1), math.random(-2,2)))+( plr:GetMouse().Hit.p - bulletposition).unit*speed
- local bulletlastposition = bulletposition
- coroutine.resume(coroutine.create(function()
- while true do
- local dt = wait()
- bulletlastposition = bulletposition
- bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*gravity, 0)*dt)
- bulletposition = bulletposition + (bulletvelocity*dt)
- local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
- local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
- if (torso.Position - rayPart.Position).magnitude > 540 then
- rayPart:Destroy()
- break
- end
- if hit then
- local damage = math.random(24, 32)
- if hit.Parent:findFirstChild("Humanoid") ~= nil then
- if OVERPowered then
- hit.Parent:BreakJoints()
- else
- hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
- billboardGui("-"..damage, rayPart)
- end
- end
- if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
- if OVERPowered then
- hit.Parent.Parent:BreakJoints()
- else
- hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
- billboardGui("-"..damage, rayPart)
- end
- if hit.Name == "Tire" and hit ~= nil then
- hit:BreakJoints()
- end
- end
- bulletposition = hitposition
- if hit.Name == "RayPart" then
- hit:Destroy()
- rayPart:Destroy()
- else
- wait(5)
- rayPart:Destroy()
- end
- break
- end
- rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(-math.pi, 0, 0)
- rayPart.Parent = workspace
- end
- end))
- end)()
- end
- mouse.Button1Down:connect(function(mouse)
- if char.Humanoid.Health == 0 then
- return end
- if debounce then return end
- debounce = true
- animate()
- rayCast(100, 7)
- wait(0.8)
- debounce = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement