thatonepuggo

leder wip

Jul 26th, 2020 (edited)
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 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 Compatibility by timlikekezenit")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83. local phy = game:GetService("PhysicsService")
  84. for i,v in pairs(phy:GetCollisionGroups()) do
  85. if v:GetCollisionGroupName()=="shieldal" or v:GetCollisionGroupName()=="shieldgr" then
  86. phy:RemoveCollisionGroup("shieldal")
  87. phy:RemoveCollisionGroup("shieldgr")
  88. end
  89. local plr = owner
  90. local lederGui = Instance.new("ScreenGui",plr.PlayerGui)
  91. local ledervolume = 2
  92. local run = game:GetService("RunService")
  93. lederGui.Name = "lederGui"
  94. lederGui.ResetOnSpawn = true
  95. local credits = Instance.new("TextLabel",lederGui)
  96. credits.Name = "lederCredits"
  97. credits.Position = UDim2.new(0,0,0,50)
  98. credits.Size = UDim2.new(1,0,0,75)
  99. credits.Text = [[LEDER SCRIPTED AND ANIMATED BY OOF0M, INSPIRED BY AZNDIB'S "GENERIC ROLEPLAY GAME"]]
  100. credits.Font = Enum.Font.GothamBlack
  101. credits.TextColor3 = Color3.new(255,255,255)
  102. credits.TextStrokeTransparency = 0
  103. credits.BackgroundColor3 = Color3.new(0,0,0)
  104. credits.BackgroundTransparency = .5
  105. credits.BorderSizePixel = 0
  106. credits.TextScaled = true
  107. delay(5,function()
  108. lederGui:Destroy()
  109. end)
  110. local char = plr.Character
  111. local ledertag = Instance.new("BillboardGui",char.Head)
  112. ledertag.Size = UDim2.new(8,0,2,0)
  113. ledertag.StudsOffset = Vector3.new(0,3,0)
  114. ledertag.LightInfluence = 0
  115. local ledertagtext = Instance.new("TextLabel",ledertag)
  116. ledertagtext.Text = "leder"
  117. ledertagtext.BackgroundTransparency = 1
  118. ledertagtext.Size = UDim2.new(1,0,1,0)
  119. ledertagtext.Font = Enum.Font.GothamBlack
  120. ledertagtext.TextColor3 = Color3.new(255,0,0)
  121. ledertagtext.TextStrokeTransparency = 0
  122. ledertagtext.TextScaled = true
  123. --[[
  124. char.Animate.idle.Animation1.AnimationId = "rbxassetid://5430782081"
  125. char.Animate.idle.Animation2.AnimationId = "rbxassetid://5436122854"
  126. char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://5436083585"
  127. char.Animate.fall.FallAnim.AnimationId = "rbxassetid://5436050339"
  128. ]]
  129. local uis = game:GetService("UserInputService")
  130. local audio = Instance.new("Sound",char.HumanoidRootPart)
  131. audio.Name = "lederMusic"
  132. audio.Volume = ledervolume
  133. audio.Looped = true
  134. audio.SoundId = "rbxassetid://2988447548"
  135. audio:Play()
  136.  
  137. -- start fake limbs
  138. local fakelimbsfolder = Instance.new("Folder",char)
  139. fakelimbsfolder.Name = "fakelimbsfolder"
  140. char.Humanoid.WalkSpeed = 50
  141. for _, child in pairs(char:GetChildren()) do
  142. if child:IsA("Part") then
  143. if child.Name ~= "Head" then
  144. if child.Name ~= "HumanoidRootPart" then
  145. child.Transparency = 1
  146. local clone = child:Clone()
  147. clone.Transparency = 0
  148. clone.Parent = fakelimbsfolder
  149. local weld = Instance.new("Weld",clone)
  150. weld.Part0 = child
  151. weld.Part1 = clone
  152. if clone.Name == "Torso" then
  153. clone.BrickColor = BrickColor.new("Really red")
  154. elseif clone.Name == "Left Leg" then
  155. clone.BrickColor = BrickColor.new("Sea green")
  156. elseif clone.Name == "Right Leg" then
  157. clone.BrickColor = BrickColor.new("Sea green")
  158. end
  159. end
  160. end
  161.  
  162. end
  163.  
  164. char.Humanoid.MaxHealth = math.huge
  165. char.Humanoid.Health = char.Humanoid.MaxHealth
  166. --end fake limbs
  167. local muted = false
  168. local shieldon = false
  169. Mouse.KeyDown:Connect(function(press)
  170. local key = string.lower(press)
  171. if key == "m" then
  172. if muted == false then
  173. muted = true
  174. audio.Volume = 0
  175. elseif muted == true then
  176. muted = false
  177. audio.Volume = ledervolume
  178. end
  179. elseif key == "c" then
  180. local Camera = workspace.CurrentCamera
  181. local projectile = Instance.new("Part",workspace)
  182. projectile.Touched:Connect(function(hit)
  183. local char2 = hit.Parent
  184. if char2:FindFirstChildWhichIsA("Humanoid") and char2 ~= char then
  185. char2:FindFirstChildWhichIsA("Humanoid").Health = 0
  186. end
  187. end)
  188. local mouse = plr:GetMouse()
  189. projectile.Material = Enum.Material.Neon
  190. projectile.BrickColor = BrickColor.new("Magenta")
  191. projectile.Size = Vector3.new(1,1,1)
  192. projectile.Position = char.HumanoidRootPart.Position
  193. projectile.Anchored = true
  194. projectile.Transparency = .5
  195. projectile.CanCollide = false
  196. local ts = game:GetService("TweenService")
  197. local goals = {Size = Vector3.new(30,30,30), Transparency = 1}
  198. local info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)
  199. ts:Create(projectile,info,goals):Play()
  200. local projectpath = Instance.new("Part",workspace)
  201. projectpath.Material = Enum.Material.ForceField
  202. projectpath.BrickColor = BrickColor.new("Magenta")
  203. projectpath.Size = Vector3.new(1,1,1)
  204. projectpath.Position = char.HumanoidRootPart.Position
  205. projectpath.Anchored = true
  206. projectpath.Transparency = 0
  207. projectpath.CanCollide = false
  208. local ts = game:GetService("TweenService")
  209. local goals = {Size = Vector3.new(30,30,30), Transparency = 1}
  210. local info = TweenInfo.new(.8,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0)
  211. ts:Create(projectpath,info,goals):Play()
  212. local sound = Instance.new("Sound",char.Torso)
  213. sound.SoundId = "rbxassetid://4996813865"
  214. sound.Name = "bruh"
  215. sound.Volume = 5
  216. sound.TimePosition = .5
  217. sound:Play()
  218. wait(1)
  219. projectile:Destroy()
  220. projectpath:Destroy()
  221. wait(1)
  222. sound:Destroy()
  223. elseif key == "f" then
  224. local changing = false
  225. if shieldon == false and changing == false then
  226. shieldon = true
  227. changing = true
  228. local shield = Instance.new("Part",char)
  229. shield.Material = Enum.Material.ForceField
  230. shield.Color = Color3.new(0,0,1)
  231. shield.TopSurface = Enum.SurfaceType.Smooth
  232. shield.BottomSurface = Enum.SurfaceType.Smooth
  233. shield.Size = Vector3.new(1,1,1)
  234. shield.Position = char.Torso.Position
  235. shield.Orientation = char.Torso.Orientation
  236. shield.Name = "lederShield"
  237. shield.CanCollide = true
  238. local shieldal = phy:CreateCollisionGroup("shieldal")
  239. local shieldgr = phy:CreateCollisionGroup("shield")
  240. for _, child in ipairs(char:GetDescendants()) do
  241. if child:IsA("Part") and child.Name ~= "lederShield" then
  242. phy:SetPartCollisionGroup(child, "shieldal")
  243. end
  244. end
  245. phy:SetPartCollisionGroup(shield, "shieldal")
  246. phy:CollisionGroupSetCollidable("shieldal", "shieldgr", false)
  247. local weld2 = Instance.new("Weld",shield)
  248. weld2.Part0 = shield
  249. weld2.Part1 = char.Head
  250. local ts = game:GetService("TweenService")
  251. local goals = {Size = Vector3.new(10,10,10)} -- 4.5,6,3
  252. local info = TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0)
  253. ts:Create(shield,info,goals):Play()
  254. wait(1)
  255. changing = false
  256. elseif shieldon == true and changing == false then
  257. shieldon = false
  258. changing = true
  259. local ts = game:GetService("TweenService")
  260. local goals = {Size = Vector3.new(1,1,1), Transparency = 1}
  261. local info = TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0)
  262. ts:Create(shield,info,goals):Play()
  263. wait(1)
  264. changing = false
  265. shield:Destroy()
  266.  
  267. end
  268. end
  269. end)
  270. end
  271. end
Add Comment
Please, Sign In to add comment