DrakrMakr

Anti Skid

Aug 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 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. script.Parent = Player.Character
  5.  
  6. --RemoteEvent for communicating
  7. local Event = Instance.new("RemoteEvent")
  8. Event.Name = "UserInput_Event"
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local function fakeEvent()
  12. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  13. t.connect = t.Connect
  14. return t
  15. end
  16.  
  17. --Creating fake input objects with fake variables
  18. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  19. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  20. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  21. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  22. end}
  23. --Merged 2 functions into one by checking amount of arguments
  24. CAS.UnbindAction = CAS.BindAction
  25.  
  26. --This function will trigger the events that have been :Connect()'ed
  27. local function te(self,ev,...)
  28. local t = m[ev]
  29. if t and t._fakeEvent and t.Function then
  30. t.Function(...)
  31. end
  32. end
  33. m.TrigEvent = te
  34. UIS.TrigEvent = te
  35.  
  36. Event.OnServerEvent:Connect(function(plr,io)
  37. if plr~=Player then return end
  38. if io.isMouse then
  39. m.Target = io.Target
  40. m.Hit = io.Hit
  41. else
  42. local b = io.UserInputState == Enum.UserInputState.Begin
  43. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  44. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  45. end
  46. for _,t in pairs(CAS.Actions) do
  47. for _,k in pairs(t.Keys) do
  48. if k==io.KeyCode then
  49. t.Function(t.Name,io.UserInputState,io)
  50. end
  51. end
  52. end
  53. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  54. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  55. end
  56. end)
  57. Event.Parent = NLS([==[
  58. local Player = game:GetService("Players").LocalPlayer
  59. local Event = script:WaitForChild("UserInput_Event")
  60.  
  61. local UIS = game:GetService("UserInputService")
  62. local input = function(io,a)
  63. if a then return end
  64. --Since InputObject is a client-side instance, we create and pass table instead
  65. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  66. end
  67. UIS.InputBegan:Connect(input)
  68. UIS.InputEnded:Connect(input)
  69.  
  70. local Mouse = Player:GetMouse()
  71. local h,t
  72. --Give the server mouse data 30 times every second, but only if the values changed
  73. --If player is not moving their mouse, client won't fire events
  74. while wait(1/30) do
  75. if h~=Mouse.Hit or t~=Mouse.Target then
  76. h,t=Mouse.Hit,Mouse.Target
  77. Event:FireServer({isMouse=true,Target=t,Hit=h})
  78. end
  79. end]==],Player.Character)
  80. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  81. end
  82. -- watchout its anti skid yaya
  83. local model = Instance.new("Model", owner.Character)
  84. model.Name = "DrakerMaker's anti skid loaded by "..owner.Name.."."
  85. local humanoid = Instance.new("Humanoid", model)
  86. local head = Instance.new("Part", model)
  87. head.Name = "Head"
  88. head.Material = "ForceField"
  89. head.Size = Vector3.new(1.5, 1.5, 1.5)
  90. head.CFrame = owner.Character.HumanoidRootPart.CFrame *CFrame.new(-3, 1, 2)
  91. head.Shape = "Ball"
  92. head.CanCollide = false
  93. head.Anchored = true
  94. deded = {}
  95. mouse.KeyDown:connect(function(key)
  96. if key == "e" then
  97. table.remove(deded, #deded)
  98. for i,v in pairs(owner.Parent:GetChildren()) do
  99. if v:IsA("Player") then
  100. local e = v.Character:GetDescendants()
  101. for i = 1,#e do
  102. if e[i]:IsA("Sound") then
  103. if e[i].Volume > 5 then
  104. if owner.Parent:FindFirstChild(v.Name) ~= nil then
  105. owner.Parent[v.Name]:LoadCharacter(true)
  106. end
  107. table.insert(deded, v.Name)
  108. end
  109. end
  110. end
  111. end
  112. end
  113. model.Name = "Some/none/a single player/person has been reset."
  114. if workspace:FindFirstChildOfClass("Sound") then
  115. workspace:FindFirstChildOfClass("Sound"):Stop()
  116. workspace:FindFirstChildOfClass("Sound"):Destroy()
  117. model.Name = "A global sound has been removed."
  118. end
  119. wait(5)
  120. model.Name = ""
  121. end
  122. if key == "z" then
  123. if mouse.Target then
  124. if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
  125. if owner.Parent:FindFirstChild(mouse.Target.Parent.Name) ~= nil then
  126. owner.Parent[mouse.Target.Parent.Name]:LoadCharacter(true)
  127. end
  128. if owner.Parent:FindFirstChild(mouse.Target.Parent.Name) == nil then
  129. for i,x in pairs(mouse.Target.Parent:GetChildren()) do x.Parent = nil end
  130. end
  131. model.Name = "A person with a OP script without a tamed loud sound has been reset."
  132. wait(5)
  133. model.Name = ""
  134. end
  135. end
  136. end
  137. end)
  138. move = coroutine.wrap(function()
  139. while wait() do
  140. for i = 0,1,0.1 do
  141. wait()
  142. head.CFrame = head.CFrame:lerp(owner.Character.HumanoidRootPart.CFrame *CFrame.new(-3, 1, 2), 0.3)
  143. end
  144. end
  145. end)
  146. move()
  147. hc = coroutine.wrap(function()
  148. owner.Character.Humanoid.HealthChanged:connect(function()
  149. owner.Character.Humanoid.Health = owner.Character.Humanoid.MaxHealth
  150. end)
  151. humanoid.HealthChanged:connect(function()
  152. humanoid.Health = humanoid.MaxHealth
  153. end)
  154. end)
  155. hc()
  156. wait(5)
  157. model.Name = ""
Add Comment
Please, Sign In to add comment