Advertisement
5325325325

Untitled

Apr 28th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.16 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. 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
  6.  
  7. --MADE BY OneLegend (NOT THE SCRIPT) REGULAR SCRIPT: JUST RUN!
  8.  
  9.  
  10. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  11.  
  12. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  13.  
  14. local p = Instance.new("Part")
  15.  
  16. p.formFactor = "Custom"
  17.  
  18. p.Anchored = Anchor
  19.  
  20. p.CanCollide = Collide
  21.  
  22. p.Transparency = Tran
  23.  
  24. p.Reflectance = Ref
  25.  
  26. p.BrickColor = BrickColor.new(Color)
  27.  
  28. for _, Surf in pairs(Surfaces) do
  29.  
  30. p[Surf] = "Smooth"
  31.  
  32. end
  33.  
  34. p.Size = Vector3.new(X, Y, Z)
  35.  
  36. if Break then
  37.  
  38. p:BreakJoints()
  39.  
  40. else p:MakeJoints() end
  41.  
  42. p.Parent = Parent
  43.  
  44. return p
  45.  
  46. end
  47.  
  48.  
  49.  
  50. function Weld(p0, p1, x, y, z, a, b, c)
  51.  
  52. local w = Instance.new("Weld")
  53.  
  54. w.Parent = p0
  55.  
  56. w.Part0 = p0
  57.  
  58. w.Part1 = p1
  59.  
  60. w.C0 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  61.  
  62. return w
  63.  
  64. end
  65.  
  66.  
  67.  
  68. function getcf(pos1, pos2)
  69.  
  70. local pos3 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
  71.  
  72. return CFrame.new(pos1, pos3)
  73.  
  74. end
  75.  
  76.  
  77.  
  78. function findjelly(pos)
  79.  
  80. local t
  81.  
  82. local d = math.huge
  83.  
  84. local h
  85.  
  86. local tors
  87.  
  88. for i,v in pairs(workspace:children()) do
  89.  
  90. t, h = v:findFirstChild("Torso"), v:findFirstChild("Humanoid")
  91.  
  92. if t ~= nil and h ~= nil then
  93.  
  94. if (t.Position - pos).magnitude < d and h.Health > 0 then
  95.  
  96. d = (t.Position - pos).magnitude
  97.  
  98. tors = t
  99.  
  100. end
  101.  
  102. end
  103.  
  104. end
  105.  
  106. return tors
  107.  
  108. end
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116. function maketroll(pos)
  117.  
  118. local model = Instance.new("Model")
  119.  
  120. model.Name = "TROLLLLLLZ"
  121.  
  122. local body = Part(model, false, true, 0, 0, "Really black", 1.3, 4.5, 1.3, true)
  123.  
  124. local bg = Instance.new("BodyGyro",body)
  125.  
  126. bg.P = 6000
  127.  
  128. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  129.  
  130. local bv = Instance.new("BodyVelocity",body)
  131.  
  132. bv.P = 6000
  133.  
  134. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  135.  
  136. bv.velocity = Vector3.new(0,0,0)
  137.  
  138. Instance.new("CylinderMesh",body)
  139.  
  140. local head = Part(model, false, true, 1, 0, "Really black", 3.5, 3.2, 0.4, true)
  141.  
  142. local neck = Weld(body, head, 0, 2.25+1.35, 0, 0, 0, 0)
  143.  
  144. local fr = Instance.new("Decal",head)
  145.  
  146. fr.Face = "Front"
  147.  
  148. fr.Texture = "http://www.roblox.com/asset/?id=29658197"
  149.  
  150. local ba = Instance.new("Decal",head)
  151.  
  152. ba.Face = "Back"
  153.  
  154. ba.Texture = "http://www.roblox.com/asset/?id=29658197"
  155.  
  156.  
  157.  
  158. local Ramodel = Instance.new("Model",model)
  159.  
  160. local rarm = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  161.  
  162. Instance.new("CylinderMesh",rarm)
  163.  
  164. local rb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  165.  
  166. local rah = Weld(body, rb, 1, 1.8, 0, 0, 0, 0)
  167.  
  168. local rw = Weld(rb, rarm, 0, 0, 0, 0, 0, math.pi/2.8)
  169.  
  170.  
  171.  
  172. for i=0, -70, -10 do
  173.  
  174. local rarm2 = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  175.  
  176. Instance.new("CylinderMesh",rarm2)
  177.  
  178. local w = Weld(rarm, rarm2, -3, 0, 0, 0, 0, math.rad(i))
  179.  
  180. w.C1 = CFrame.new(-3,0,0)
  181.  
  182. end
  183.  
  184.  
  185.  
  186. local Lamodel = Instance.new("Model",model)
  187.  
  188. local larm = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  189.  
  190. Instance.new("CylinderMesh",larm)
  191.  
  192. local lb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  193.  
  194. local lah = Weld(body, lb, -1, 1.8, 0, 0, 0, 0)
  195.  
  196. local lw = Weld(lb, larm, 0, 0, 0, 0, math.pi, math.pi/2.8)
  197.  
  198.  
  199.  
  200. for i=0, -70, -10 do
  201.  
  202. local larm2 = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  203.  
  204. Instance.new("CylinderMesh",larm2)
  205.  
  206. local w = Weld(larm, larm2, -3, 0, 0, 0, 0, math.rad(i))
  207.  
  208. w.C1 = CFrame.new(-3,0,0)
  209.  
  210. end
  211.  
  212.  
  213.  
  214. local Rlmodel = Instance.new("Model",model)
  215.  
  216. local rleg = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  217.  
  218. Instance.new("CylinderMesh",rleg)
  219.  
  220. local rlb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  221.  
  222. local rlh = Weld(body, rlb, 0, -1.9, 0, 0, 0, 0)
  223.  
  224. local rlw = Weld(rlb, rleg, 0, 0, 0, 0, 0, math.pi/2.8)
  225.  
  226.  
  227.  
  228. for i=0, -70, -10 do
  229.  
  230. local rleg2 = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  231.  
  232. Instance.new("CylinderMesh",rleg2)
  233.  
  234. local w = Weld(rleg, rleg2, -3, 0, 0, 0, 0, math.rad(i))
  235.  
  236. w.C1 = CFrame.new(-3,0,0)
  237.  
  238. end
  239.  
  240.  
  241.  
  242. local Llmodel = Instance.new("Model",model)
  243.  
  244. local lleg = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  245.  
  246. Instance.new("CylinderMesh",lleg)
  247.  
  248. local llb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  249.  
  250. local llh = Weld(body, llb, 0, -1.9, 0, 0, 0, 0)
  251.  
  252. local llw = Weld(llb, lleg, 0, 0, 0, 0, math.pi, math.pi/2.8)
  253.  
  254.  
  255.  
  256. for i=0, -70, -10 do
  257.  
  258. local lleg2 = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  259.  
  260. Instance.new("CylinderMesh",lleg2)
  261.  
  262. local w = Weld(lleg, lleg2, -3, 0, 0, 0, 0, math.rad(i))
  263.  
  264. w.C1 = CFrame.new(-3,0,0)
  265.  
  266. end
  267.  
  268. model.Parent = workspace
  269.  
  270. model:MakeJoints()
  271.  
  272. model:MoveTo(pos)
  273.  
  274. coroutine.resume(coroutine.create(function()
  275.  
  276. while true do
  277.  
  278. wait()
  279.  
  280. if body.Velocity.magnitude > 2 then
  281.  
  282. coroutine.resume(coroutine.create(function()
  283.  
  284. for i=0,40,5 do
  285.  
  286. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  287.  
  288. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  289.  
  290. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  291.  
  292. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  293.  
  294. wait()
  295.  
  296. end
  297.  
  298. for i=40,-40,-5 do
  299.  
  300. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  301.  
  302. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  303.  
  304. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  305.  
  306. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  307.  
  308. wait()
  309.  
  310. end
  311.  
  312. for i=-40,0,5 do
  313.  
  314. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  315.  
  316. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  317.  
  318. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  319.  
  320. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  321.  
  322. wait()
  323.  
  324. end
  325.  
  326. end))
  327.  
  328. end
  329.  
  330. local jelly = findjelly(body.Position)
  331.  
  332. if jelly ~= nil then
  333.  
  334. bg.cframe = getcf(body.Position, jelly.Position)
  335.  
  336. bv.velocity = bg.cframe.lookVector * 25
  337.  
  338. else
  339.  
  340. bv.velocity = Vector3.new(0,0,0)
  341.  
  342. end
  343.  
  344. end
  345.  
  346. end))
  347.  
  348. end
  349.  
  350.  
  351.  
  352. maketroll(Vector3.new(0,5,0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement