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,game,owner = owner,game
- local RealPlayer = Player
- do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end -- > CREATED BY WULFBUG9 2014
- -- > Seriously, I made this. (wulfbug9)
- -- > I'm releasing a ton of my other scripts on this pastebin, too. So go check them out.
- function rand(a)return (math.random()-.5)*2*a end
- function q(f,arg)return coroutine.resume(coroutine.create(f),unpack(arg or {}))end
- function fade(p,s)q(function(part,start)for i=start,1,.05 do part.Transparency = part.Transparency+0.05 wait(1/30)end end,{p,s})end
- function appear(p,s)q(function(part,start)for i=start,0,-.05 do part.Transparency = part.Transparency-0.05 wait(1/30)end end,{p,s})end
- function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("Part",Parent)p.Name = Name
- p.FormFactor = "Custom"p.Size = Size
- p.Anchored = Anch p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
- p.TopSurface = 0 p.CanCollide = Can
- p.BottomSurface = 0 p.Material = Mat
- p.Reflectance = Ref or 0;p:BreakJoints()
- p.Locked = true;return p
- end
- function WedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("WedgePart",Parent)p.Name = Name
- p.FormFactor = "Custom"p.Size = Size
- p.Anchored = Anch p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
- p.TopSurface = 0 p.CanCollide = Can
- p.BottomSurface = 0 p.Material = Mat
- p.Reflectance = Ref or 0;p:BreakJoints()
- p.Locked = true;return p
- end
- function CornerWedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
- local p = Instance.new("CornerWedgePart",Parent)p.Name = Name;p.Size = Size
- p.Anchored = Anch p.CFrame = CFrame
- p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
- p.TopSurface = 0 p.CanCollide = Can
- p.BottomSurface = 0 p.Material = Mat
- p.Reflectance = Ref or 0;p:BreakJoints()
- p.Locked = true;return p
- end
- function Mesh(Parent,Type,Scale,ID,TID)
- local m = Instance.new("SpecialMesh",Parent)m.MeshType = Type
- m.Scale = Scale or Vector3.new(1,1,1)
- if ID then m.MeshId = ID end if TID then m.TextureId = TID end
- return m
- end
- function Weld(p1,p2,c0,c1)
- local w = Instance.new("Weld",p1)w.Part0 = p1;w.Part1 = p2
- w.C0,w.C1 = c0 or CFrame.new(),c1 or CFrame.new()
- return w
- end
- function cslerp(c1,c2,t)
- local function s(a,b,c)return (1-c)*a+(c*b)end
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
- local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1)do com1[i] = s(v,com2[i],t)end
- return CFrame.new(com1[1],com1[2],com1[3])*CFrame.Angles(select(4,unpack(com1)))
- end
- local char
- ---------------------------------------------
- player = game:service("Players").LocalPlayer
- repeat wait() char = player.Character until char
- pcall(function()char:FindFirstChild("Animate"):Destroy()end)
- root = char:WaitForChild("HumanoidRootPart")
- torso = char:WaitForChild("Torso")
- humanoid = char:WaitForChild("Humanoid")
- mouse = player:GetMouse()
- step = game:service("RunService").Stepped
- asset = "http://www.roblox.com/asset/?id="
- meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
- sounds = {["explode"] = 130792180;}
- colour = "White"
- scolour = tostring(BrickColor.random())--"Lime green"
- Attacking = false
- local bv,bp,bg
- hover = 10
- carspeed = 60
- keysdown = {}
- c0ls = CFrame.new(-1,0.5,0)*CFrame.Angles(math.pi/6,0,0)
- c0rs = CFrame.new(1,0.5,0)*CFrame.Angles(math.pi/6,0,0)
- c1ls = CFrame.new(0.5,0.5,0)
- c1rs = CFrame.new(-0.5,0.5,0)
- c0tw = CFrame.new(0,0,0)
- c1tw = CFrame.new(0,0,0)
- rs = Weld(torso,char:WaitForChild("Right Arm"),c0rs,c1rs)
- ls = Weld(torso,char:WaitForChild("Left Arm"),c0ls,c1ls)
- tw = Weld(root,torso,c0tw,c1tw)
- ---------------------------------------------
- function Smoke(origin,color)
- local p = Part("Effect",workspace,Vector3.new(2,2,2),origin*CFrame.new(rand(10),-1,rand(10)),color or "Black",.1,false,false,"SmoothPlastic")
- local m = Mesh(p,"Sphere",Vector3.new(1.25,1.25,1.25))
- local bp = Instance.new("BodyPosition",p)bp.D = 100 bp.P = 100 bp.position = p.Position+Vector3.new(0,7,0)
- q(function(pa,me)
- fade(pa,.1)
- for i=25,100 do
- me.Scale = me.Scale+Vector3.new(0.15,0.1,0.15)
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function crownExplode(origin,color,size)
- local p = Part("Effect",workspace,Vector3.new(size,size,size),origin,color,.2,true,false,"SmoothPlastic")
- local m = Mesh(p,"FileMesh",Vector3.new(size/2,size/2,size/2),asset..meshes["crown"])
- q(function(pa,me)
- for i=.2,1,.025 do
- me.Scale = me.Scale+Vector3.new(0.75,0.75,0.75)
- pa.Transparency = i
- wait(1/30)
- end
- pa:Destroy()
- end,{p,m})
- end
- function quickSound(id,v)
- local s = Instance.new("Sound",workspace)
- s.SoundId = id
- s.PlayOnRemove = true
- s.Volume = v or 1
- delay(0.025,function()s:remove()end)
- end
- function checkDmgArea(origin,dmg,d)
- for i,v in pairs(workspace:children())do
- if v~=char and v:FindFirstChild("Torso") then
- local h;
- for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
- local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
- if dist < d and h~=nil then
- h.Health = h.Health - dmg
- end
- end
- end
- end
- function Shoot(start,dmg)
- dmg = dmg or 15
- local vel = start.lookVector
- local p = Part("Bullet",workspace,Vector3.new(4,4,4),start,"Black",0,true,false,"SmoothPlastic")
- local m = Mesh(p,"Sphere")
- local num = 0
- local ign = char:children()
- local connect
- connect = step:connect(function()
- num = num + 1
- local pp = p.Position
- local h,po
- vel = vel - Vector3.new(0,math.min(999.5,vel.magnitude/50),0)
- repeat
- local r = Ray.new(pp,vel.unit*math.min(999.5,vel.magnitude/100+4))
- h,po = workspace:FindPartOnRayWithIgnoreList(r,ign)
- if h then
- if h.CanCollide then break
- else table.insert(ign,h)h = nil
- end
- else break
- end
- until false
- p.CFrame = CFrame.new(po,po+vel)
- q(function(b)
- local a = b:Clone()
- a.Parent = workspace
- for i=1,-.05,-.05 do
- wait()
- a:FindFirstChild("Mesh").Scale = Vector3.new(i,i,i)
- a.Transparency = a.Transparency + .05
- end
- a:Destroy()
- end,{p})
- if h or num > 300 then
- local cf = p.CFrame
- for i=1,3 do Smoke(cf*CFrame.new(0,4,0),"Black")end
- crownExplode(CFrame.new(cf.x,cf.y,cf.z),"Black",2)
- quickSound(asset..sounds["explode"],2)
- checkDmgArea(cf,dmg,10)
- p:Destroy()
- connect:disconnect()
- end
- end)
- end
- function Fire()
- Attacking = true
- for i=1,10 do
- wait(1/30)
- local speed = i/10
- rs.C0 = cslerp(rs.C0,c0rs*CFrame.Angles(-math.pi/2.5,0,0),speed)
- ls.C0 = cslerp(ls.C0,c0ls*CFrame.Angles(-math.pi/2.5,0,0),speed)
- tw.C0 = cslerp(tw.C0,c0tw*CFrame.Angles(0,math.pi/2,0),speed)
- end
- local b = Part("Bullet",char,Vector3.new(4,4,4),torso.CFrame,"Black",0,false,false,"SmoothPlastic")
- Mesh(b,"Sphere")
- local w = Weld(torso,b,CFrame.new(0,0,-.5))
- for i=1,5 do
- wait(1/30)
- local speed = i/5
- rs.C0 = cslerp(rs.C0,c0rs*CFrame.Angles(math.pi/2.5,0,0),speed)
- ls.C0 = cslerp(ls.C0,c0ls*CFrame.Angles(math.pi/2.5,0,0),speed)
- tw.C0 = cslerp(tw.C0,c0tw,speed)
- w.C0 = cslerp(w.C0,CFrame.new(0,5,-3),speed)
- end
- Shoot(b.CFrame,52.5)
- b:Destroy()
- for i=1,10 do
- wait(1/30)
- local speed = i/20
- rs.C0 = cslerp(rs.C0,c0rs,speed)
- ls.C0 = cslerp(ls.C0,c0ls,speed)
- tw.C0 = cslerp(tw.C0,c0tw,speed)
- end
- Attacking = false
- end
- ---------------------------------------------
- pcall(function()char:FindFirstChild("CAR"):Destroy()end)
- model = Instance.new("Model",char)
- model.Name = "CAR"
- base = Part("P",model,Vector3.new(6,6,6),torso.CFrame*CFrame.new(6,6,0),colour,0,false,false,"Plastic")
- torso.CFrame = base.CFrame
- basem = Mesh(base,"Sphere",Vector3.new(1,.5,1))
- side = Part("P",model,Vector3.new(6,2,6),torso.CFrame*CFrame.new(6,6,0),colour,0,false,false,"Plastic")
- sidem = Mesh(side,"FileMesh",Vector3.new(5.375,5.375,20),asset..meshes["ring"])
- sidew = Weld(base,side,CFrame.new(0,1,0)*CFrame.Angles(math.pi/2,0,0))
- side2 = Part("P",model,Vector3.new(6,2,6),torso.CFrame*CFrame.new(6,6,0),scolour,0,false,false,"Plastic")
- side2m = Mesh(side2,"FileMesh",Vector3.new(5.375,5.375,5),asset..meshes["ring"])
- side2w = Weld(side,side2,CFrame.new(0,0,-1.25))
- under = Part("P",model,Vector3.new(2,6,2),torso.CFrame*CFrame.new(6,6,0),scolour,0,false,false,"Plastic")
- underm = Mesh(under,"FileMesh",Vector3.new(2,6,2),asset..meshes["spike"])
- underw = Weld(base,under,CFrame.new(0,-1,0)*CFrame.Angles(math.pi,0,0))
- prop = Part("P",model,Vector3.new(0.5,0,4),torso.CFrame*CFrame.new(6,6,0),scolour,0,false,false,"Plastic")
- propm = Mesh(prop,"Sphere")
- propw = Weld(under,prop,CFrame.new(0,2.25,0))
- torweld = Weld(base,root,CFrame.new(0,3,-1))
- bp = Instance.new("BodyPosition")
- bp.maxForce = Vector3.new(0,1/0,0)
- bv = Instance.new("BodyVelocity")
- bv.maxForce = Vector3.new(1/0,0,1/0)
- bg = Instance.new("BodyGyro")
- bg.maxTorque = Vector3.new(1/0,1/0,1/0)
- humanoid.WalkSpeed = 0
- ---------------------------------------------
- mouse.KeyDown:connect(function(key)
- key:lower()
- keysdown[key] = true
- end)
- mouse.KeyUp:connect(function(key)
- key:lower()
- keysdown[key] = false
- end)
- mouse.Button1Down:connect(function()
- if not Attacking then
- Fire()
- end
- end)
- local function bn(key) return keysdown[key]and 1 or 0 end
- ---------------------------------------------
- step:connect(function()
- hover = hover-bn("e")+bn("q")
- bp.Parent,bg.Parent,bv.Parent = base,base,base
- bp.position = Vector3.new(0,math.sin(tick())+hover,0)
- bg.cframe = workspace.CurrentCamera.CoordinateFrame
- local vel = workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(Vector3.new(0-bn("a")+bn("d"),0,0-bn("w")+bn("s")))*Vector3.new(1,0,1)
- bv.velocity = (vel.magnitude > 0 and vel.unit*carspeed)or Vector3.new(0,0,0)
- propw.C0 = propw.C0*CFrame.Angles(0,.2,0)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement