Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- -- watchout its anti skid yaya
- local model = Instance.new("Model", owner.Character)
- model.Name = "DrakerMaker's anti skid loaded by "..owner.Name.."."
- local humanoid = Instance.new("Humanoid", model)
- local head = Instance.new("Part", model)
- head.Name = "Head"
- head.Material = "ForceField"
- head.Size = Vector3.new(1.5, 1.5, 1.5)
- head.CFrame = owner.Character.HumanoidRootPart.CFrame *CFrame.new(-3, 1, 2)
- head.Shape = "Ball"
- head.CanCollide = false
- head.Anchored = true
- deded = {}
- mouse.KeyDown:connect(function(key)
- if key == "e" then
- table.remove(deded, #deded)
- for i,v in pairs(owner.Parent:GetChildren()) do
- if v:IsA("Player") then
- local e = v.Character:GetDescendants()
- for i = 1,#e do
- if e[i]:IsA("Sound") then
- if e[i].Volume > 5 then
- if owner.Parent:FindFirstChild(v.Name) ~= nil then
- owner.Parent[v.Name]:LoadCharacter(true)
- end
- table.insert(deded, v.Name)
- end
- end
- end
- end
- end
- model.Name = "Some/none/a single player/person has been reset."
- if workspace:FindFirstChildOfClass("Sound") then
- workspace:FindFirstChildOfClass("Sound"):Stop()
- workspace:FindFirstChildOfClass("Sound"):Destroy()
- model.Name = "A global sound has been removed."
- end
- wait(5)
- model.Name = ""
- end
- if key == "z" then
- if mouse.Target then
- if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
- if owner.Parent:FindFirstChild(mouse.Target.Parent.Name) ~= nil then
- owner.Parent[mouse.Target.Parent.Name]:LoadCharacter(true)
- end
- if owner.Parent:FindFirstChild(mouse.Target.Parent.Name) == nil then
- for i,x in pairs(mouse.Target.Parent:GetChildren()) do x.Parent = nil end
- end
- model.Name = "A person with a OP script without a tamed loud sound has been reset."
- wait(5)
- model.Name = ""
- end
- end
- end
- end)
- move = coroutine.wrap(function()
- while wait() do
- for i = 0,1,0.1 do
- wait()
- head.CFrame = head.CFrame:lerp(owner.Character.HumanoidRootPart.CFrame *CFrame.new(-3, 1, 2), 0.3)
- end
- end
- end)
- move()
- hc = coroutine.wrap(function()
- owner.Character.Humanoid.HealthChanged:connect(function()
- owner.Character.Humanoid.Health = owner.Character.Humanoid.MaxHealth
- end)
- humanoid.HealthChanged:connect(function()
- humanoid.Health = humanoid.MaxHealth
- end)
- end)
- hc()
- wait(5)
- model.Name = ""
Add Comment
Please, Sign In to add comment