View difference between Paste ID: vN3xchGW and q8VZKyCP
SHOW: | | - or go back to the newest paste.
1
--just put this on the top of a script and boom 89% works
2
--note this does not work on big scripts
3
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
4
local Player,game,owner = owner,game
5
local RealPlayer = Player
6
do
7
    local rp = RealPlayer
8
    script.Parent = rp.Character
9
   
10
    --RemoteEvent for communicating
11
    local Event = Instance.new("RemoteEvent")
12
    Event.Name = "UserInput_Event"
13
 
14
    --Fake event to make stuff like Mouse.KeyDown work
15
    local function fakeEvent()
16
        local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
17
        t.connect = t.Connect
18
        return t
19
    end
20
 
21
    --Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
    end}
27
    --Merged 2 functions into one by checking amount of arguments
28
    CAS.UnbindAction = CAS.BindAction
29
 
30
    --This function will trigger the events that have been :Connect()'ed
31-
clone.Head.face.Texture = "http://www.roblox.com/asset/?id=174717392"
31+
    local function te(self,ev,...)
32
        local t = m[ev]
33
        if t and t._fakeEvent then
34
            for _,f in pairs(t.Functions) do
35
                f(...)
36
            end
37
        end
38
    end
39
    m.TrigEvent = te
40
    UIS.TrigEvent = te
41
 
42
    Event.OnServerEvent:Connect(function(plr,io)
43
        if plr~=rp then return end
44
        m.Target = io.Target
45
        m.Hit = io.Hit
46
        if not io.isMouse then
47
            local b = io.UserInputState == Enum.UserInputState.Begin
48
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
49
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
50
            end
51
            for _,t in pairs(CAS.Actions) do
52
                for _,k in pairs(t.Keys) do
53
                    if k==io.KeyCode then
54
                        t.Function(t.Name,io.UserInputState,io)
55
                    end
56
                end
57
            end
58
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
59
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
60
        end
61
    end)
62
    Event.Parent = NLS([==[
63
    local Player = game:GetService("Players").LocalPlayer
64
    local Event = script:WaitForChild("UserInput_Event")
65
 
66
    local Mouse = Player:GetMouse()
67
    local UIS = game:GetService("UserInputService")
68
    local input = function(io,a)
69
        if a then return end
70
        --Since InputObject is a client-side instance, we create and pass table instead
71
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
72
    end
73
    UIS.InputBegan:Connect(input)
74
    UIS.InputEnded:Connect(input)
75
 
76
    local h,t
77
    --Give the server mouse data 30 times every second, but only if the values changed
78
    --If player is not moving their mouse, client won't fire events
79
    while wait(1/30) do
80
        if h~=Mouse.Hit or t~=Mouse.Target then
81
            h,t=Mouse.Hit,Mouse.Target
82
            Event:FireServer({isMouse=true,Target=t,Hit=h})
83
        end
84
    end]==],Player.Character)
85
 
86
    ----Sandboxed game object that allows the usage of client-side methods and services
87
    --Real game object
88
    local _rg = game
89
 
90
    --Metatable for fake service
91
    local fsmt = {
92
        __index = function(self,k)
93
            local s = rawget(self,"_RealService")
94
            if s then return s[k] end
95
        end,
96
        __newindex = function(self,k,v)
97
            local s = rawget(self,"_RealService")
98
            if s then s[k]=v end
99
        end,
100
        __call = function(self,...)
101
            local s = rawget(self,"_RealService")
102
            if s then return s(...) end
103
        end
104
    }
105
    local function FakeService(t,RealService)
106
        t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
107
        return setmetatable(t,fsmt)
108
    end
109
 
110
    --Fake game object
111
    local g = {
112
        GetService = function(self,s)
113
            return self[s]
114
        end,
115
        Players = FakeService({
116
            LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
117
        },"Players"),
118
        UserInputService = FakeService(UIS,"UserInputService"),
119
        ContextActionService = FakeService(CAS,"ContextActionService"),
120
    }
121
    rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
122
    g.service = g.GetService
123
   
124
    g.RunService = FakeService({
125
        RenderStepped = _rg:GetService("RunService").Heartbeat,
126
        BindToRenderStep = function(self,name,_,fun)
127
            self._btrs[name] = self.Heartbeat:Connect(fun)
128
        end,
129
        UnbindFromRenderStep = function(self,name)
130
            self._btrs[name]:Disconnect()
131
        end,
132
    },"RunService")
133
 
134
    setmetatable(g,{
135
        __index=function(self,s)
136
            return _rg:GetService(s) or typeof(_rg[s])=="function"
137
            and function(_,...)return _rg[s](_rg,...)end or _rg[s]
138
        end,
139
        __newindex = fsmt.__newindex,
140
        __call = fsmt.__call
141
    })
142
    --Changing owner to fake player object to support owner:GetMouse()
143
    game,owner = g,g.Players.LocalPlayer
144
end
145
 
146
147
--[[
148
    Small but silent. But nto the impact sounds...
149
    Use it on Void Script builder!
150
AAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
151
--]]
152
--Credit To Rufus14 For creating the script!
153
--I just edit it a bit ツ
154
mouse = game.Players.LocalPlayer:GetMouse()
155
function ragdoll()
156
game.Players.LocalPlayer.Character.Archivable = true
157
clone = game.Players.LocalPlayer.Character:Clone()
158
clone.Parent = workspace
159
for i,v in pairs(clone:GetChildren()) do
160
    if v.ClassName == "Script" or v.ClassName == "LocalScript" then
161
        v:destroy()
162
    end
163
    for i,p in pairs(v:GetChildren()) do
164
    if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
165
        p:destroy()
166
    end
167
end
168
end
169
for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
170
    if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
171
        t:destroy()
172
    end
173
end
174
vel = Instance.new("BodyVelocity", clone.Torso)
175
vel.Velocity = clone.Torso.CFrame.lookVector * -5
176
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
177
clone.Head.face.Texture = "http://www.roblox.com/asset/?id=7074749"
178
using = false
179
hit = Instance.new("Sound", clone.Torso)
180
hit.SoundId = "rbxassetid://178646271" --Main Body Impact
181
hit.Volume = 5
182
hit1 = Instance.new("Sound", clone.Torso)
183-
        if Math == 2 then
183+
184
hit1.Volume = 5
185
hit2 = Instance.new("Sound", clone.Torso)
186-
        if Math == 3 then
186+
187
hit2.Volume = 5
188
hit3 = Instance.new("Sound", clone.Torso)
189-
        if Math == 4 then
189+
190
hit3.Volume = 5
191
hit3.TimePosition = 0.33
192
ded = Instance.new("Sound", clone.Torso)
193
ded.SoundId = "rbxassetid://" --Death Sound
194
ded.Volume = 5
195
local leftarm = clone:findFirstChild("Left Arm")
196
local rightrm = clone:findFirstChild("Right Arm")
197
local leftleg = clone:findFirstChild("Left Leg")
198
local rightleg = clone:findFirstChild("Right Leg")
199
local head = clone:findFirstChild("Head")
200
local welding = Instance.new("Weld", clone.Torso)
201
welding.Part0 = clone.Torso
202
welding.Part1 = head
203
welding.C0 = welding.C0 * CFrame.new(0,1.5,0)
204
for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
205
    if g.ClassName == "Part" then
206
        g:destroy()
207
    end
208
end
209
for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
210
    if h.ClassName == "Accesory" then
211
        h:destroy()
212
    end
213
end
214
game.Workspace.CurrentCamera.CameraSubject = head
215
if leftleg ~= nil then
216
local glue = Instance.new("Glue", clone.Torso)
217
glue.Part0 = clone.Torso
218
glue.Part1 = leftleg
219
glue.Name = "Left leg"
220
local collider = Instance.new("Part", leftleg)
221
collider.Position = Vector3.new(0,999,0)
222
collider.Size = Vector3.new(1.7, 1, 1)
223
collider.Shape = "Cylinder"
224
local weld = Instance.new("Weld", collider)
225
weld.Part0 = leftleg
226
weld.Part1 = collider
227
weld.C0 = CFrame.Angles(0, 0, 80)
228
collider.TopSurface = "Smooth"
229
collider.BottomSurface = "Smooth"
230
collider.formFactor = "Symmetric"
231
glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
232
glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
233
collider.Transparency = 1
234
end
235
------------
236
if rightleg ~= nil then
237
local glue1 = Instance.new("Glue", clone.Torso)
238
glue1.Part0 = clone.Torso
239
glue1.Part1 = rightleg
240
glue1.Name = "Right leg"
241
local collider1 = Instance.new("Part", rightleg)
242
collider1.Position = Vector3.new(0,999,0)
243
collider1.Size = Vector3.new(1.7, 1, 1)
244
collider1.Shape = "Cylinder"
245
local weld1 = Instance.new("Weld", collider1)
246
weld1.Part0 = rightleg
247
weld1.Part1 = collider1
248
weld1.C0 = CFrame.Angles(0, 0, 80)
249
collider1.TopSurface = "Smooth"
250
collider1.BottomSurface = "Smooth"
251
collider1.formFactor = "Symmetric"
252
glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
253
glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
254
collider1.Transparency = 1
255
end
256
------------
257
if rightrm ~= nil then
258
local glue11 = Instance.new("Glue", clone.Torso)
259
glue11.Part0 = clone.Torso
260
glue11.Part1 = rightrm
261
glue11.Name = "Right shoulder"
262
local collider11 = Instance.new("Part", rightrm)
263
collider11.Position = Vector3.new(0,9999,0)
264
collider11.Size = Vector3.new(1.8,1,1)
265
collider11.Shape = "Cylinder"
266
local weld11 = Instance.new("Weld", collider11)
267
weld11.Part0 = rightrm
268
weld11.Part1 = collider11
269
weld11.C0 = CFrame.Angles(0, 0, 80)
270
collider11.TopSurface = "Smooth"
271
collider11.BottomSurface = "Smooth"
272
collider11.formFactor = "Symmetric"
273
glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
274
glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
275
collider11.Transparency = 1
276
end
277
------------
278
if leftarm ~= nil then
279
local glue111 = Instance.new("Glue", clone.Torso)
280
glue111.Part0 = clone.Torso
281
glue111.Part1 = leftarm
282
glue111.Name = "Left shoulder"
283
local collider111 = Instance.new("Part", leftarm)
284
collider111.Position = Vector3.new(0,9999,0)
285
collider111.Size = Vector3.new(1.8,1,1)
286
collider111.Shape = "Cylinder"
287
local weld111 = Instance.new("Weld", collider111)
288
weld111.Part0 = leftarm
289
weld111.Part1 = collider111
290
weld111.C0 = CFrame.Angles(0, 0, 80)
291
collider111.TopSurface = "Smooth"
292
collider111.BottomSurface = "Smooth"
293
collider111.formFactor = "Symmetric"
294
glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
295
glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
296
collider111.Transparency = 1
297
----------------
298
sensoring = Instance.new("Part", clone.Torso)
299
sensoring.Size = Vector3.new(1.2,1.1,0.8)
300
sensoring.CanCollide = false
301
sensoring.Position = clone.Torso.Position
302
local welder = Instance.new("Weld", sensoring)
303
welder.Part0 = clone.Torso
304
welder.Part1 = sensoring
305
welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
306
sensoring.Transparency = 1
307
-----------------
308
sensoring1 = Instance.new("Part", clone.Torso)
309
sensoring1.Size = Vector3.new(1.2,1.1,0.8)
310
sensoring1.CanCollide = false
311
sensoring1.Position = clone.Torso.Position
312
local welder1 = Instance.new("Weld", sensoring)
313
welder1.Part0 = clone.Torso
314
welder1.Part1 = sensoring1
315
welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
316
sensoring1.Transparency = 1
317
end
318
clone.Name = game.Players.LocalPlayer.Character.Name.." (DEAD)"
319
ded:Play()
320
vel:destroy()
321
wait(0.5)
322
local function touch()
323
    if not using then
324
        using = true
325
        local Math = math.random(1,4)
326
        if Math == 1 then
327
            hit:Play()
328
329
        elseif Math == 2 then
330
            hit1:Play()
331
332
        elseif Math == 3 then
333
            hit2:Play()
334
335
        elseif Math == 4 then
336
            hit3:Play()
337
        end
338
        wait(0.1)
339
        using = false
340
    end
341
end
342
sensoring.Touched:connect(touch)
343
sensoring1.Touched:connect(touch)
344
wait(4.47)
345
hit1.Volume = 0
346
hit2.Volume = 0
347
hit3.Volume = 0
348
hit.Volume = 0
349
        end
350
 
351
game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll)
352
 
353
--di ent