SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | if game.PlaceId == 843468296 or game.PlaceId == 843495510 or game.PlaceId == 897312463 then | |
3 | ||
4 | ||
5 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
6 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
7 | do | |
8 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
9 | script.Parent = Player.Character | |
10 | ||
11 | --RemoteEvent for communicating | |
12 | local Event = Instance.new("RemoteEvent") | |
13 | Event.Name = "UserInput_Event" | |
14 | ||
15 | --Fake event to make stuff like Mouse.KeyDown work | |
16 | local function fakeEvent() | |
17 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
18 | t.connect = t.Connect | |
19 | return t | |
20 | end | |
21 | ||
22 | --Creating fake input objects with fake variables | |
23 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
24 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
25 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
26 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
27 | end} | |
28 | --Merged 2 functions into one by checking amount of arguments | |
29 | CAS.UnbindAction = CAS.BindAction | |
30 | ||
31 | --This function will trigger the events that have been :Connect()'ed | |
32 | local function te(self,ev,...) | |
33 | local t = m[ev] | |
34 | if t and t._fakeEvent and t.Function then | |
35 | t.Function(...) | |
36 | end | |
37 | end | |
38 | m.TrigEvent = te | |
39 | UIS.TrigEvent = te | |
40 | ||
41 | Event.OnServerEvent:Connect(function(plr,io) | |
42 | if plr~=Player then return end | |
43 | if io.isMouse then | |
44 | m.Target = io.Target | |
45 | m.Hit = io.Hit | |
46 | else | |
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 UIS = game:GetService("UserInputService") | |
67 | local input = function(io,a) | |
68 | if a then return end | |
69 | --Since InputObject is a client-side instance, we create and pass table instead | |
70 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
71 | end | |
72 | UIS.InputBegan:Connect(input) | |
73 | UIS.InputEnded:Connect(input) | |
74 | ||
75 | local Mouse = Player:GetMouse() | |
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 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
86 | end | |
87 | ||
88 | function DE_Ragdoll(player) | |
89 | wait(1/math.huge) | |
90 | local pc = player.Character | |
91 | if pc~=nil then | |
92 | local hum = pc:FindFirstChild'Humanoid' | |
93 | local LArm = pc:FindFirstChild'Left Arm' | |
94 | local RArm = pc:FindFirstChild'Right Arm' | |
95 | local LLeg = pc:FindFirstChild'Left Leg' | |
96 | local RLeg = pc:FindFirstChild'Right Leg' | |
97 | local torso = pc:FindFirstChild'Torso' | |
98 | local head = pc:FindFirstChild'Head' | |
99 | ||
100 | ||
101 | local LUA = pc:FindFirstChild'LeftUpperArm' | |
102 | local LLA = pc:FindFirstChild'LeftLowerArm' | |
103 | local LH = pc:FindFirstChild'LeftHand' | |
104 | ||
105 | local RUA = pc:FindFirstChild'RightUpperArm' | |
106 | local RLA = pc:FindFirstChild'RightLowerArm' | |
107 | local RH = pc:FindFirstChild'RightHand' | |
108 | ||
109 | local LUL = pc:FindFirstChild'LeftUpperLeg' | |
110 | local LLL = pc:FindFirstChild'LeftLowerLeg' | |
111 | local LF = pc:FindFirstChild'LeftFoot' | |
112 | ||
113 | local RUL = pc:FindFirstChild'RightUpperLeg' | |
114 | local RLL = pc:FindFirstChild'RightLowerLeg' | |
115 | local RF = pc:FindFirstChild'RightFoot' | |
116 | ||
117 | local UT = pc:FindFirstChild'UpperTorso' | |
118 | local LT = pc:FindFirstChild'LowerTorso' | |
119 | ||
120 | if hum and LArm and RArm and LLeg and RLeg and head then | |
121 | hum.BreakJointsOnDeath = false | |
122 | hum.Died:Connect(function() | |
123 | if hum.RigType==Enum.HumanoidRigType.R6 then | |
124 | for _,v in pairs(torso:GetChildren())do | |
125 | if v:IsA'Motor6D' and v.Name~="Neck" then | |
126 | v:Destroy() | |
127 | end | |
128 | end | |
129 | local vis = false | |
130 | local vis2 = false | |
131 | ||
132 | local at1 = Instance.new("Attachment",torso) | |
133 | at1.Visible = vis | |
134 | at1.Orientation = torso.Orientation + Vector3.new(0,180,0) | |
135 | at1.Position = Vector3.new(-1,1,0) | |
136 | ||
137 | local at1p2 = Instance.new("Attachment",LArm) | |
138 | at1p2.Visible = vis | |
139 | at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0) | |
140 | at1p2.Position = Vector3.new(.5,1,0) | |
141 | ||
142 | local bis = Instance.new("BallSocketConstraint",torso) | |
143 | bis.Attachment0 = at1 | |
144 | bis.Attachment1 = at1p2 | |
145 | bis.LimitsEnabled = true | |
146 | bis.UpperAngle = 15 | |
147 | bis.Visible = vis2 | |
148 | bis.TwistLimitsEnabled = true | |
149 | bis.UpperAngle = -45 | |
150 | bis.TwistLowerAngle = -45 | |
151 | ||
152 | local at2 = Instance.new("Attachment",torso) | |
153 | at2.Visible = vis | |
154 | at2.Orientation = torso.Orientation + Vector3.new(0,0,0) | |
155 | at2.Position = Vector3.new(1,1,0) | |
156 | ||
157 | local at2p2 = Instance.new("Attachment",RArm) | |
158 | at2p2.Visible = vis | |
159 | at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0) | |
160 | at2p2.Position = Vector3.new(-.5,1,0) | |
161 | ||
162 | local bis2 = Instance.new("BallSocketConstraint",torso) | |
163 | bis2.Attachment0 = at2 | |
164 | bis2.Attachment1 = at2p2 | |
165 | bis2.LimitsEnabled = true | |
166 | bis2.UpperAngle = 15 | |
167 | bis2.Visible = vis2 | |
168 | bis2.TwistLimitsEnabled = true | |
169 | bis2.UpperAngle = -45 | |
170 | bis2.TwistLowerAngle = -45 | |
171 | ||
172 | local at3 = Instance.new("Attachment",torso) | |
173 | at3.Visible = vis | |
174 | at3.Orientation = torso.Orientation + Vector3.new(90,0,-90) | |
175 | at3.Position = Vector3.new(.5,-1,0) | |
176 | ||
177 | local at3p2 = Instance.new("Attachment",RLeg) | |
178 | at3p2.Visible = vis | |
179 | at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90) | |
180 | at3p2.Position = Vector3.new(0,1,0) | |
181 | ||
182 | local bis3 = Instance.new("BallSocketConstraint",torso) | |
183 | bis3.Attachment0 = at3 | |
184 | bis3.Attachment1 = at3p2 | |
185 | bis3.LimitsEnabled = true | |
186 | bis3.UpperAngle = 180-15 | |
187 | bis3.Visible = vis2 | |
188 | ||
189 | local at4 = Instance.new("Attachment",torso) | |
190 | at4.Visible = vis | |
191 | at4.Orientation = torso.Orientation + Vector3.new(90,0,-90) | |
192 | at4.Position = Vector3.new(-.5,-1,0) | |
193 | ||
194 | local at4p2 = Instance.new("Attachment",LLeg) | |
195 | at4p2.Visible = vis | |
196 | at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90) | |
197 | at4p2.Position = Vector3.new(0,1,0) | |
198 | ||
199 | local bis4 = Instance.new("BallSocketConstraint",torso) | |
200 | bis4.Attachment0 = at4 | |
201 | bis4.Attachment1 = at4p2 | |
202 | bis4.LimitsEnabled = true | |
203 | bis4.UpperAngle = 180-15 | |
204 | bis4.Visible = vis2 | |
205 | ||
206 | ||
207 | local at5 = Instance.new("Attachment",torso) | |
208 | at5.Visible = vis | |
209 | at5.Orientation = torso.Orientation + Vector3.new(180,90,0) | |
210 | at5.Position = Vector3.new(0,1,0) | |
211 | ||
212 | local at5p2 = Instance.new("Attachment",head) | |
213 | at5p2.Visible = vis | |
214 | at5p2.Orientation = head.Orientation + Vector3.new(180,90,0) | |
215 | at5p2.Position = Vector3.new(0,-.5,0) | |
216 | ||
217 | local bis5 = Instance.new("BallSocketConstraint",torso) | |
218 | bis5.Attachment0 = at5p2 | |
219 | bis5.Attachment1 = at5 | |
220 | bis5.LimitsEnabled = true | |
221 | bis5.UpperAngle = 75 | |
222 | bis5.Visible = vis2 | |
223 | bis5.TwistLimitsEnabled = true | |
224 | bis5.UpperAngle = -45 | |
225 | bis5.TwistLowerAngle = -45 | |
226 | end | |
227 | end) | |
228 | elseif head and hum then | |
229 | hum.BreakJointsOnDeath = false | |
230 | hum.Died:Connect(function() | |
231 | if hum.RigType==Enum.HumanoidRigType.R15 then | |
232 | for _,v in pairs(pc:GetDescendants())do | |
233 | if v:IsA'Motor6D' and name~="Neck"then | |
234 | v:Destroy() | |
235 | end | |
236 | end | |
237 | local vis = false | |
238 | local vis2 = false | |
239 | ||
240 | local bsc1 = Instance.new("BallSocketConstraint",UT) | |
241 | bsc1.Attachment0 = LF.LeftAnkleRigAttachment | |
242 | bsc1.Attachment1 = LLL.LeftAnkleRigAttachment | |
243 | ||
244 | local bsc2 = Instance.new("BallSocketConstraint",UT) | |
245 | bsc2.Attachment0 = LLL.LeftKneeRigAttachment | |
246 | bsc2.Attachment1 = LUL.LeftKneeRigAttachment | |
247 | ||
248 | local bsc3 = Instance.new("BallSocketConstraint",UT) | |
249 | bsc3.Attachment0 = LUL.LeftHipRigAttachment | |
250 | bsc3.Attachment1 = LT.LeftHipRigAttachment | |
251 | ||
252 | local bsc4 = Instance.new("BallSocketConstraint",UT) | |
253 | bsc4.Attachment0 = RF.RightAnkleRigAttachment | |
254 | bsc4.Attachment1 = RLL.RightAnkleRigAttachment | |
255 | ||
256 | local bsc5 = Instance.new("BallSocketConstraint",UT) | |
257 | bsc5.Attachment0 = RLL.RightKneeRigAttachment | |
258 | bsc5.Attachment1 = RUL.RightKneeRigAttachment | |
259 | ||
260 | local bsc6 = Instance.new("BallSocketConstraint",UT) | |
261 | bsc6.Attachment0 = RUL.RightHipRigAttachment | |
262 | bsc6.Attachment1 = LT.RightHipRigAttachment | |
263 | ||
264 | ||
265 | local bsc7 = Instance.new("BallSocketConstraint",UT) | |
266 | bsc7.Attachment0 = LH.LeftWristRigAttachment | |
267 | bsc7.Attachment1 = LLA.LeftWristRigAttachment | |
268 | ||
269 | local bsc8 = Instance.new("BallSocketConstraint",UT) | |
270 | bsc8.Attachment0 = LLA.LeftElbowRigAttachment | |
271 | bsc8.Attachment1 = LUA.LeftElbowRigAttachment | |
272 | ||
273 | local bsc9 = Instance.new("BallSocketConstraint",UT) | |
274 | bsc9.Attachment0 = LUA.LeftShoulderAttachment | |
275 | bsc9.Attachment1 = UT.LeftCollarAttachment | |
276 | ||
277 | local bsc10 = Instance.new("BallSocketConstraint",UT) | |
278 | bsc10.Attachment0 = RH.RightWristRigAttachment | |
279 | bsc10.Attachment1 = RLA.RightWristRigAttachment | |
280 | ||
281 | local bsc11 = Instance.new("BallSocketConstraint",UT) | |
282 | bsc11.Attachment0 = RLA.RightElbowRigAttachment | |
283 | bsc11.Attachment1 = RUA.RightElbowRigAttachment | |
284 | ||
285 | local bsc12 = Instance.new("BallSocketConstraint",UT) | |
286 | bsc12.Attachment0 = RUA.RightShoulderAttachment | |
287 | bsc12.Attachment1 = UT.RightCollarAttachment | |
288 | ||
289 | local bsc13 = Instance.new("BallSocketConstraint",UT) | |
290 | bsc13.Attachment0 = LT.WaistRigAttachment | |
291 | bsc13.Attachment1 = UT.WaistRigAttachment | |
292 | ||
293 | local bsc14 = Instance.new("BallSocketConstraint",UT) | |
294 | bsc14.Attachment0 = UT.NeckRigAttachment | |
295 | bsc14.Attachment1 = head.NeckRigAttachment | |
296 | bsc14.LimitsEnabled = true | |
297 | bsc14.UpperAngle = -75 | |
298 | bsc14.TwistLimitsEnabled = true | |
299 | bsc14.UpperAngle = -45 | |
300 | bsc14.TwistLowerAngle = -45 | |
301 | ||
302 | end | |
303 | end) | |
304 | end | |
305 | end | |
306 | end | |
307 | ||
308 | local part = Instance.new("Part",workspace) | |
309 | part.Name = "OuterLaser" | |
310 | part.Anchored = true | |
311 | part.Position = Vector3.new(0,1000,0) | |
312 | local at1 = Instance.new("Attachment",part) | |
313 | local trail = Instance.new("Beam",part) | |
314 | trail.LightEmission = 1 | |
315 | trail.Texture = "rbxassetid://1203352006" | |
316 | trail.TextureMode = "Stretch" | |
317 | trail.TextureLength = 1 | |
318 | trail.TextureSpeed = 1 | |
319 | trail.FaceCamera = true | |
320 | trail.Width0 = 3 | |
321 | trail.Width1 = 3 | |
322 | trail.Attachment0 = at1 | |
323 | mouse.KeyDown:Connect(function(key) | |
324 | if key=="r" then | |
325 | local hit = mouse.Hit | |
326 | local tar = mouse.Target | |
327 | ||
328 | local part2 = Instance.new("Part",workspace) | |
329 | part2.Anchored = true | |
330 | part2.CFrame = hit | |
331 | part2.Transparency = 1 | |
332 | local at2 = Instance.new("Attachment",part2) | |
333 | trail.Attachment1 = at2 | |
334 | if tar~=nil then | |
335 | if (tar.Parent:FindFirstChildWhichIsA'Humanoid' or tar.Parent:IsA'Accessory') and tar~=part2 then | |
336 | local pare = nil | |
337 | if tar.Parent:FindFirstChildWhichIsA'Humanoid' then | |
338 | pare = tar.Parent | |
339 | elseif tar.Parent:IsA'Accessory' then | |
340 | pare = tar.Parent.Parent | |
341 | end | |
342 | if pare:FindFirstChildWhichIsA'Humanoid' then | |
343 | ||
344 | local hum = pare:FindFirstChildWhichIsA'Humanoid' | |
345 | if game.PlaceId~=843468296 then | |
346 | hum.Health = 0 | |
347 | end | |
348 | if game:GetService'Players':FindFirstChild(pare.Name) then | |
349 | DE_Ragdoll(game:GetService'Players':FindFirstChild(pare.Name)) | |
350 | end | |
351 | end | |
352 | end | |
353 | end | |
354 | wait(.25) | |
355 | part2:Destroy() | |
356 | end | |
357 | end) | |
358 | for _,v in pairs(workspace:GetChildren())do | |
359 | if game:GetService'Players':FindFirstChild(v.Name) then | |
360 | DE_Ragdoll(game:GetService'Players':FindFirstChild(v.Name)) | |
361 | end | |
362 | end | |
363 | workspace.ChildAdded:Connect(function(ch) | |
364 | if game:GetService'Players':FindFirstChild(ch.Name) then | |
365 | DE_Ragdoll(game:GetService'Players':FindFirstChild(ch.Name)) | |
366 | end | |
367 | end) | |
368 | end |