Advertisement
JacksoMykalJunior

Untitled

Mar 6th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Covered By Red_Jack142 | FE Made By Red_Jack142")
  5. print("Have Fun!")
  6. script.Parent = Player.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent and t.Function then
  32. t.Function(...)
  33. end
  34. end
  35. m.TrigEvent = te
  36. UIS.TrigEvent = te
  37.  
  38. Event.OnServerEvent:Connect(function(plr,io)
  39. if plr~=Player then return end
  40. if io.isMouse then
  41. m.Target = io.Target
  42. m.Hit = io.Hit
  43. else
  44. local b = io.UserInputState == Enum.UserInputState.Begin
  45. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  46. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  47. end
  48. for _,t in pairs(CAS.Actions) do
  49. for _,k in pairs(t.Keys) do
  50. if k==io.KeyCode then
  51. t.Function(t.Name,io.UserInputState,io)
  52. end
  53. end
  54. end
  55. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  57. end
  58. end)
  59. Event.Parent = NLS([==[
  60. local Player = owner
  61. local Event = script:WaitForChild("UserInput_Event")
  62.  
  63. local UIS = game:GetService("UserInputService")
  64. local input = function(io,a)
  65. if a then return end
  66. --Since InputObject is a client-side instance, we create and pass table instead
  67. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  68. end
  69. UIS.InputBegan:Connect(input)
  70. UIS.InputEnded:Connect(input)
  71.  
  72. local Mouse = Player:GetMouse()
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84.  
  85.  
  86. Parts={}
  87. function GetDiscoColor(hue)
  88. local section = hue % 1 * 3
  89. local secondary = 0.5 * math.pi * (section % 1)
  90. if section < 1 then
  91. return Vector3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
  92. elseif section < 2 then
  93. return Vector3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
  94. else
  95. return Vector3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
  96. end
  97. end
  98. Part = function(x,y,z,color,tr,cc,an,parent)
  99. local p = Instance.new('Part',parent or Weapon)
  100. p.formFactor = 'Custom'
  101. p.Size = Vector3.new(x,y,z)
  102. p.BrickColor = BrickColor.new(color)
  103. p.CanCollide = cc
  104. p.Transparency = tr
  105. p.Anchored = an
  106. p.TopSurface,p.BottomSurface = 0,0
  107. p:BreakJoints''
  108. table.insert(Parts,p)
  109. return p
  110. end
  111. Weld = function(p0,p1)
  112. local w = Instance.new('Motor',p0)
  113. w.Part0 = p0
  114. w.Part1 = p1
  115. return w
  116. end
  117. Mesh = function(par,num,x,y,z)
  118. local msh = 0
  119. if num == 1 then
  120. msh = Instance.new("SpecialMesh",par)
  121. msh.MeshId='rbxasset://fonts/torso.mesh'
  122. msh.TextureId='rbxasset://25701026'
  123. end
  124. if num == 2 then
  125. msh = Instance.new("SpecialMesh",par)
  126. msh.MeshId='rbxasset://fonts/head.mesh'
  127. msh.TextureId='rbxassetid://25701026'
  128. end
  129. msh.Scale = Vector3.new(x,y,z)
  130. return msh
  131. end
  132. plr=owner
  133. char=plr.Character
  134. for _,v in pairs(char:GetChildren()) do
  135. if v.ClassName=="Part" then
  136. v.Transparency=1
  137. elseif v.ClassName=="Hat" then
  138. v.Handle.Mesh.TextureId='rbxassetid://25701026'
  139. table.insert(Parts,v.Handle)
  140. end
  141. end
  142. t=Part(1,1,1,'',0,false,false,char)
  143. Mesh(t,1,1,1,1)
  144. Weld(char.Torso,t)
  145. a=Part(1,1,1,'',0,false,false,char)
  146. Mesh(a,1,.5,1,1)
  147. Weld(char['Right Arm'],a)
  148. a=Part(1,1,1,'',0,false,false,char)
  149. Mesh(a,1,.5,1,1)
  150. Weld(char['Left Arm'],a)
  151. l=Part(1,1,1,'',0,false,false,char)
  152. Mesh(l,1,.5,1,1)
  153. Weld(char['Right Leg'],l)
  154. l=Part(1,1,1,'',0,false,false,char)
  155. Mesh(l,1,.5,1,1)
  156. Weld(char['Left Leg'],l)
  157. h=Part(1,1,1,'',0,false,false,char)
  158. Mesh(h,2,1,1,1)
  159. Weld(char.Head,h)
  160. Spawn(function()
  161. while(coroutine.yield())do
  162. for i=1,#Parts do
  163. Parts[i].Mesh.VertexColor=GetDiscoColor(tick()*.5)--vertex 4 lyfe
  164. end
  165. end;
  166. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement