SHOW:
|
|
- or go back to the newest paste.
1 | - | --Enjoy this shit |
1 | + | --]] |
2 | - | --When you Click its explode asf |
2 | + | --https://github.com/Mokiros/roblox-FE-compatibility |
3 | - | --Touch kids with the sword to kill them. |
3 | + | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
4 | - | --Made by N3xul |
4 | + | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
5 | local RealPlayer = Player | |
6 | do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end | |
7 | ||
8 | local runDummyScript = function(f,scri) | |
9 | local oldenv = getfenv(f) | |
10 | local newenv = setmetatable({}, { | |
11 | __index = function(_, k) | |
12 | if k:lower() == 'script' then | |
13 | return scri | |
14 | else | |
15 | return oldenv[k] | |
16 | end | |
17 | end | |
18 | }) | |
19 | setfenv(f, newenv) | |
20 | ypcall(function() f() end) | |
21 | end | |
22 | cors = {} | |
23 | mas = Instance.new("Model",game:GetService("Lighting")) | |
24 | mas.Name = "CompiledModel" | |
25 | o1 = Instance.new("HopperBin") | |
26 | o2 = Instance.new("LocalScript") | |
27 | o1.Name = "OPSwords" | |
28 | o1.Parent = mas | |
29 | o1.TextureId = "http://www.roblox.com/asset/?id=23722071" | |
30 | o2.Name = "AnimDeath" | |
31 | o2.Parent = o1 | |
32 | table.insert(cors,coroutine.create(function() | |
33 | wait() | |
34 | runDummyScript(function() | |
35 | print("Animator Loaded."); | |
36 | ||
37 | --Animation Manager-- | |
38 | local bin = script.Parent; | |
39 | while (game.Players.LocalPlayer.Character == nil) do | |
40 | wait() | |
41 | end | |
42 | print("Player found. :)"); | |
43 | local player = game.Players.LocalPlayer.Character; | |
44 | local human = player.Humanoid; | |
45 | ||
46 | --Tool Variables-- | |
47 | local tselected = false; | |
48 | ||
49 | --Base Part-- | |
50 | local block = Instance.new("Part"); | |
51 | block.FormFactor = "Symmetric"; | |
52 | block.Size = Vector3.new(1, 1, 1); | |
53 | block.Transparency = 1; | |
54 | block.CanCollide = false; | |
55 | block.Locked = true; | |
56 | ||
57 | local sword = Instance.new("Part"); | |
58 | sword.FormFactor = "Plate"; | |
59 | sword.Shape = "Block"; | |
60 | sword.Size = Vector3.new(1, 0.8, 4); | |
61 | sword.Transparency = 1; | |
62 | sword.CanCollide = false; | |
63 | local SlashSound = Instance.new("Sound") | |
64 | SlashSound.SoundId = "http://www.roblox.com/asset/?id=11998777" | |
65 | SlashSound.Pitch = 1.4; | |
66 | SlashSound.Looped = true; | |
67 | SlashSound.Name = "Voom"; | |
68 | SlashSound.Parent = sword | |
69 | snd = Instance.new("Sound") | |
70 | snd.SoundId = "http://www.roblox.com/asset/?id=2233908" | |
71 | snd.Volume = 1 | |
72 | snd.Name = "Boom" | |
73 | snd.Parent = sword | |
74 | local UnsheathSound = Instance.new("Sound") | |
75 | UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=11998770" | |
76 | UnsheathSound.Name = "Go" | |
77 | UnsheathSound.Volume = 0.5 | |
78 | UnsheathSound.Parent = sword | |
79 | local mesh = Instance.new("SpecialMesh"); | |
80 | mesh.MeshType = "FileMesh"; | |
81 | mesh.MeshId = "http://www.roblox.com/asset/?id=11996935"; | |
82 | mesh.Scale = Vector3.new(1.4,1.4,1.4); | |
83 | mesh.TextureId = "http://www.roblox.com/asset/?id=23719291"; | |
84 | mesh.Parent = sword; | |
85 | local sparkle = Instance.new("Sparkles") | |
86 | sparkle.SparkleColor = Color3.new(0, 255, 155); | |
87 | sparkle.Parent = sword; | |
88 | sparkle.Enabled = false; | |
89 | local sword2 = sword:Clone(); | |
90 | ||
91 | local lsweld = Instance.new("Weld"); | |
92 | local rsweld = Instance.new("Weld"); | |
93 | --Left Arm Positioners and Welders-- | |
94 | local lPosBase = block:Clone(); | |
95 | local lPosWeld = Instance.new("Weld"); | |
96 | local lRotBase = block:Clone(); | |
97 | local lRotWeld = Instance.new("Weld"); | |
98 | local lArmWeld = Instance.new("Weld"); | |
99 | ||
100 | --Right Arm Positioners and Welders-- | |
101 | local rPosBase = block:Clone(); | |
102 | local rPosWeld = Instance.new("Weld"); | |
103 | local rRotBase = block:Clone(); | |
104 | local rRotWeld = Instance.new("Weld"); | |
105 | local rArmWeld = Instance.new("Weld"); | |
106 | ||
107 | --Head Welder-- | |
108 | local hRotBase = block:Clone(); | |
109 | local hRotWeld = Instance.new("Weld"); | |
110 | local headWeld = Instance.new("Weld"); | |
111 | ||
112 | --Bind the base parts to the Torso. Tricky. | |
113 | ||
114 | --Left-- | |
115 | lPosBase.Name = "LPosBase"; | |
116 | lPosWeld.Name = "LPosWeld"; | |
117 | lRotBase.Name = "LRotBase"; | |
118 | lRotWeld.Name = "LRotWeld"; | |
119 | lPosWeld.Part0 = player.Torso; | |
120 | lPosWeld.Part1 = lPosBase; | |
121 | lPosWeld.C1 = CFrame.new(1.5, -0.5, 0); | |
122 | lPosWeld.Parent = player.Torso; | |
123 | lPosBase.Parent = player; | |
124 | lRotWeld.Part0 = lPosBase; | |
125 | lRotWeld.Part1 = lRotBase; | |
126 | lRotWeld.Parent = player.Torso; | |
127 | lRotBase.Parent = player; | |
128 | lArmWeld.Part0 = lRotBase; | |
129 | lArmWeld.C1 = CFrame.new(0, 0.5, 0); | |
130 | lArmWeld.Parent = player.Torso; | |
131 | ||
132 | --Right-- | |
133 | rPosBase.Name = "RPosBase"; | |
134 | rPosWeld.Name = "RPosWeld"; | |
135 | rRotBase.Name = "RRotBase"; | |
136 | rRotWeld.Name = "RRotWeld"; | |
137 | rPosWeld.Part0 = player.Torso; | |
138 | rPosWeld.Part1 = rPosBase; | |
139 | rPosWeld.C1 = CFrame.new(-1.5, -0.5, 0); | |
140 | rPosWeld.Parent = player.Torso; | |
141 | rPosBase.Parent = player; | |
142 | rRotWeld.Part0 = rPosBase; | |
143 | rRotWeld.Part1 = rRotBase; | |
144 | rRotWeld.Parent = player.Torso; | |
145 | rRotBase.Parent = player; | |
146 | rArmWeld.Part0 = rRotBase; | |
147 | rArmWeld.C1 = CFrame.new(0, 0.5, 0); | |
148 | rArmWeld.Parent = player.Torso; | |
149 | ||
150 | --Head-- | |
151 | hRotBase.Name = "HRotBase"; | |
152 | hRotWeld.Name = "HRotWeld"; | |
153 | headWeld.Name = "HeadWeld"; | |
154 | hRotWeld.Part0 = player.Torso; | |
155 | hRotWeld.Part1 = hRotBase; | |
156 | hRotWeld.C1 = CFrame.new(0, -1.5, 0); | |
157 | hRotWeld.Parent = player.Torso; | |
158 | hRotBase.Parent = player; | |
159 | headWeld.Part0 = hRotBase; | |
160 | headWeld.Parent = player.Torso; | |
161 | ||
162 | --Le Swords-- | |
163 | lsweld.Part0 = lRotBase; | |
164 | rsweld.Part0 = rRotBase; | |
165 | lsweld.Part1 = sword; | |
166 | rsweld.Part1 = sword2; | |
167 | lsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0); | |
168 | rsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0); | |
169 | lsweld.Parent = player.Torso; | |
170 | rsweld.Parent = player.Torso; | |
171 | sword.Parent = player; | |
172 | sword2.Parent = player; | |
173 | sword.Voom:Stop(); | |
174 | sword2.Voom:Stop(); | |
175 | print("Bases binded."); | |
176 | ||
177 | --Binds the arms and head to the base parts. | |
178 | function bind() | |
179 | lArmWeld.Part1 = player:FindFirstChild("Left Arm"); | |
180 | rArmWeld.Part1 = player:FindFirstChild("Right Arm"); | |
181 | headWeld.Part1 = player:FindFirstChild("Head"); | |
182 | sword.Transparency = 0; | |
183 | sword2.Transparency = 0; | |
184 | sword.Go:Play(); | |
185 | sword2.Go:Play(); | |
186 | sword.Sparkles.Enabled = true; | |
187 | sword2.Sparkles.Enabled = true; | |
188 | human.WalkSpeed = 28; | |
189 | sword.Voom:Play(); | |
190 | sword2.Voom:Play(); | |
191 | end | |
192 | ||
193 | --Releases the arms and head from the base parts. | |
194 | function unbind() | |
195 | lArmWeld.Part1 = nil; | |
196 | rArmWeld.Part1 = nil; | |
197 | headWeld.Part1 = nil; | |
198 | sword.Transparency = 1; | |
199 | sword2.Transparency = 1; | |
200 | sword.Sparkles.Enabled = false; | |
201 | sword2.Sparkles.Enabled = false; | |
202 | human.WalkSpeed = 28; | |
203 | sword.Go:Play(); | |
204 | sword2.Go:Play(); | |
205 | sword.Voom:Stop(); | |
206 | sword2.Voom:Stop(); | |
207 | end | |
208 | ||
209 | function boom(part) | |
210 | wait(); | |
211 | if part == nil or tselected == false then return end; | |
212 | if part.Anchored then return end; | |
213 | if part.Parent == player or part.Parent.Parent == player then return end; | |
214 | human:TakeDamage(-1); | |
215 | sword.Sparkles:Clone().Parent = part; | |
216 | sword.Go:Play(); | |
217 | sword2.Go:Play(); | |
218 | wait(0.5) | |
219 | part:BreakJoints(); | |
220 | part.Velocity = Vector3.new(part.Velocity.X+ math.random(10, 20), part.Velocity.Y + math.random(100, 200), part.Velocity.Z+ math.random(10, 20)); | |
221 | game.Debris:AddItem(part, 10); | |
222 | end | |
223 | ||
224 | local load = true; | |
225 | ||
226 | function selected(mouse) | |
227 | mouse.Icon = "rbxasset://textures\\GunCursor.png" | |
228 | bind(); | |
229 | human.MaxHealth = 9999999; | |
230 | if player:FindFirstChild("ForceField") then | |
231 | player.ForceField:Destroy(); | |
232 | end | |
233 | tselected = true; | |
234 | mouse.Button1Down:connect(function() | |
235 | if (load) then | |
236 | mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" | |
237 | load = false | |
238 | sword.Boom:Play(); | |
239 | sword2.Boom:Play(); | |
240 | local e = Instance.new("Explosion"); | |
241 | e.Hit:connect(boom); | |
242 | e.Position = player.Torso.Position; | |
243 | e.BlastPressure = 0; | |
244 | e.BlastRadius = 1000; | |
245 | e.Parent = game.Workspace; | |
246 | human:TakeDamage(50); | |
247 | wait(1) | |
248 | mouse.Icon = "rbxasset://textures\\GunCursor.png" | |
249 | load = true | |
250 | end | |
251 | end) | |
252 | while tselected do | |
253 | lRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360))); | |
254 | rRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360))); | |
255 | human:TakeDamage(-0.25); | |
256 | wait(); | |
257 | end | |
258 | end | |
259 | ||
260 | function deselected() | |
261 | tselected = false; | |
262 | unbind(); | |
263 | human.MaxHealth = 9999999; | |
264 | end | |
265 | ||
266 | --Event Listeners-- | |
267 | sword.Touched:connect(boom); | |
268 | sword2.Touched:connect(boom); | |
269 | human.Jumping:connect(function()if tselected == false then return end player.Torso.Velocity = Vector3.new(player.Torso.Velocity.X, player.Torso.Velocity.Y + 40, player.Torso.Velocity.Z)end); | |
270 | --Tool-- | |
271 | bin.Selected:connect(selected); | |
272 | bin.Deselected:connect(deselected); | |
273 | end,o2) | |
274 | end)) | |
275 | mas.Parent = workspace | |
276 | mas:MakeJoints() | |
277 | local mas1 = mas:GetChildren() | |
278 | for i=1,#mas1 do | |
279 | mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack | |
280 | ypcall(function() mas1[i]:MakeJoints() end) | |
281 | end | |
282 | mas:Destroy() | |
283 | for i=1,#cors do | |
284 | coroutine.resume(cors[i]) | |
285 | end |