SHOW:
|
|
- or go back to the newest paste.
1 | function sandbox(var,func) | |
2 | local env = getfenv(func) | |
3 | local newenv = setmetatable({},{ | |
4 | __index = function(self,k) | |
5 | if k=="script" then | |
6 | return var | |
7 | else | |
8 | return env[k] | |
9 | end | |
10 | end, | |
11 | }) | |
12 | setfenv(func,newenv) | |
13 | return func | |
14 | end | |
15 | cors = {} | |
16 | mas = Instance.new("Model",game:GetService("Lighting")) | |
17 | Tool0 = Instance.new("Tool") | |
18 | Part1 = Instance.new("Part") | |
19 | Sound2 = Instance.new("Sound") | |
20 | Sound3 = Instance.new("Sound") | |
21 | Sound4 = Instance.new("Sound") | |
22 | Part5 = Instance.new("Part") | |
23 | Decal6 = Instance.new("Decal") | |
24 | Decal7 = Instance.new("Decal") | |
25 | Part8 = Instance.new("Part") | |
26 | Decal9 = Instance.new("Decal") | |
27 | Decal10 = Instance.new("Decal") | |
28 | Part11 = Instance.new("Part") | |
29 | Decal12 = Instance.new("Decal") | |
30 | Decal13 = Instance.new("Decal") | |
31 | Part14 = Instance.new("Part") | |
32 | Decal15 = Instance.new("Decal") | |
33 | Decal16 = Instance.new("Decal") | |
34 | PointLight17 = Instance.new("PointLight") | |
35 | Weld18 = Instance.new("Weld") | |
36 | Weld19 = Instance.new("Weld") | |
37 | Weld20 = Instance.new("Weld") | |
38 | Weld21 = Instance.new("Weld") | |
39 | WeldConstraint22 = Instance.new("WeldConstraint") | |
40 | WeldConstraint23 = Instance.new("WeldConstraint") | |
41 | WeldConstraint24 = Instance.new("WeldConstraint") | |
42 | WeldConstraint25 = Instance.new("WeldConstraint") | |
43 | Script26 = Instance.new("Script") | |
44 | LocalScript27 = Instance.new("LocalScript") | |
45 | Camera28 = Instance.new("Camera") | |
46 | Tool0.Name = "Rift" | |
47 | Tool0.Parent = mas | |
48 | Tool0.TextureId = "rbxasset://Textures/Sword128.png" | |
49 | Tool0.Grip = CFrame.new(-0.0215187073, 0, 0.249089241, 0, 0, 1, 1, 0, 0, 0, 1, 0) | |
50 | Tool0.GripForward = Vector3.new(-1, -0, -0) | |
51 | Tool0.GripPos = Vector3.new(-0.0215187073, 0, 0.249089241) | |
52 | Tool0.GripRight = Vector3.new(0, 1, 0) | |
53 | Tool0.GripUp = Vector3.new(0, 0, 1) | |
54 | Part1.Name = "Handle" | |
55 | Part1.Parent = Tool0 | |
56 | Part1.CFrame = CFrame.new(-9.39999962, 2.00000095, -9.50000095, 1.1920929e-07, -1, 2.77318406e-07, 3.85828599e-07, 2.98453244e-08, 1.00000048, -1.00000072, -8.94069672e-08, -7.44502188e-07) | |
57 | Part1.Orientation = Vector3.new(-90, 90, 0) | |
58 | Part1.Position = Vector3.new(-9.39999962, 2.00000095, -9.50000095) | |
59 | Part1.Rotation = Vector3.new(-90, 0, 90) | |
60 | Part1.Color = Color3.new(0.388235, 0.372549, 0.384314) | |
61 | Part1.Transparency = 1 | |
62 | Part1.Size = Vector3.new(1, 0.800000012, 4) | |
63 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
64 | Part1.BrickColor = BrickColor.new("Dark stone grey") | |
65 | Part1.Locked = true | |
66 | Part1.Reflectance = 0.40000000596046 | |
67 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
68 | Part1.brickColor = BrickColor.new("Dark stone grey") | |
69 | Part1.FormFactor = Enum.FormFactor.Plate | |
70 | Part1.formFactor = Enum.FormFactor.Plate | |
71 | Sound2.Name = "SwordSlash" | |
72 | Sound2.Parent = Part1 | |
73 | Sound2.SoundId = "rbxassetid://2571935805" | |
74 | Sound2.Volume = 5 | |
75 | Sound3.Name = "SwordLunge" | |
76 | Sound3.Parent = Part1 | |
77 | Sound3.SoundId = "rbxassetid://1759712659" | |
78 | Sound3.Volume = 5 | |
79 | Sound4.Name = "Unsheath" | |
80 | Sound4.Parent = Part1 | |
81 | Sound4.Looped = true | |
82 | Sound4.SoundId = "rbxassetid://2241931437" | |
83 | Sound4.Volume = 1 | |
84 | Part5.Parent = Part1 | |
85 | Part5.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
86 | Part5.Orientation = Vector3.new(0, -90, 0) | |
87 | Part5.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
88 | Part5.Rotation = Vector3.new(0, -90, 0) | |
89 | Part5.Transparency = 100 | |
90 | Part5.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
91 | Part5.BottomSurface = Enum.SurfaceType.Smooth | |
92 | Part5.CanCollide = false | |
93 | Part5.TopSurface = Enum.SurfaceType.Smooth | |
94 | Decal6.Parent = Part5 | |
95 | Decal6.Texture = "rbxassetid://2171273825" | |
96 | Decal7.Parent = Part5 | |
97 | Decal7.Texture = "rbxassetid://2171273825" | |
98 | Decal7.Face = Enum.NormalId.Back | |
99 | Part8.Parent = Part1 | |
100 | Part8.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
101 | Part8.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
102 | Part8.Transparency = 100 | |
103 | Part8.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
104 | Part8.BottomSurface = Enum.SurfaceType.Smooth | |
105 | Part8.CanCollide = false | |
106 | Part8.TopSurface = Enum.SurfaceType.Smooth | |
107 | Decal9.Parent = Part8 | |
108 | Decal9.Texture = "rbxassetid://2171273825" | |
109 | Decal10.Parent = Part8 | |
110 | Decal10.Texture = "rbxassetid://2171273825" | |
111 | Decal10.Face = Enum.NormalId.Back | |
112 | Part11.Parent = Part1 | |
113 | Part11.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, -0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, -0.707106829) | |
114 | Part11.Orientation = Vector3.new(0, -135, 0) | |
115 | Part11.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
116 | Part11.Rotation = Vector3.new(-180, -45, -180) | |
117 | Part11.Transparency = 100 | |
118 | Part11.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
119 | Part11.BottomSurface = Enum.SurfaceType.Smooth | |
120 | Part11.CanCollide = false | |
121 | Part11.TopSurface = Enum.SurfaceType.Smooth | |
122 | Decal12.Parent = Part11 | |
123 | Decal12.Texture = "rbxassetid://2171273825" | |
124 | Decal13.Parent = Part11 | |
125 | Decal13.Texture = "rbxassetid://2171273825" | |
126 | Decal13.Face = Enum.NormalId.Back | |
127 | Part14.Parent = Part1 | |
128 | Part14.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
129 | Part14.Orientation = Vector3.new(0, -45, 0) | |
130 | Part14.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
131 | Part14.Rotation = Vector3.new(0, -45, 0) | |
132 | Part14.Transparency = 100 | |
133 | Part14.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
134 | Part14.BottomSurface = Enum.SurfaceType.Smooth | |
135 | Part14.CanCollide = false | |
136 | Part14.TopSurface = Enum.SurfaceType.Smooth | |
137 | Decal15.Parent = Part14 | |
138 | Decal15.Texture = "rbxassetid://2171273825" | |
139 | Decal16.Parent = Part14 | |
140 | Decal16.Texture = "rbxassetid://2171273825" | |
141 | Decal16.Face = Enum.NormalId.Back | |
142 | PointLight17.Parent = Part14 | |
143 | PointLight17.Range = 40 | |
144 | Weld18.Parent = Part14 | |
145 | Weld18.C1 = CFrame.new(-0.0550193787, 0.0600004196, 0.0550351143, -0.707107127, 3.85828599e-07, -0.707107365, -0.707106829, 2.98453244e-08, 0.707106709, -3.30348826e-07, 1.00000048, -7.22536242e-07) | |
146 | Weld18.Part0 = Part14 | |
147 | Weld18.Part1 = Part1 | |
148 | Weld18.part1 = Part1 | |
149 | Weld19.Parent = Part14 | |
150 | Weld19.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, 0.707106829, 0, 1, 0, -0.707106829, 0, 0.707106829) | |
151 | Weld19.Part0 = Part14 | |
152 | Weld19.Part1 = Part5 | |
153 | Weld19.part1 = Part5 | |
154 | Weld20.Parent = Part14 | |
155 | Weld20.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
156 | Weld20.Part0 = Part14 | |
157 | Weld20.Part1 = Part8 | |
158 | Weld20.part1 = Part8 | |
159 | Weld21.Parent = Part14 | |
160 | Weld21.C1 = CFrame.new(0, 0, 0, 0, 0, 1.00000012, 0, 1, 0, -1.00000012, 0, 0) | |
161 | Weld21.Part0 = Part14 | |
162 | Weld21.Part1 = Part11 | |
163 | Weld21.part1 = Part11 | |
164 | WeldConstraint22.Parent = Part1 | |
165 | WeldConstraint22.Part0 = Part1 | |
166 | WeldConstraint22.Part1 = Part5 | |
167 | WeldConstraint23.Parent = Part1 | |
168 | WeldConstraint23.Part0 = Part1 | |
169 | WeldConstraint23.Part1 = Part8 | |
170 | WeldConstraint24.Parent = Part1 | |
171 | WeldConstraint24.Part0 = Part1 | |
172 | WeldConstraint24.Part1 = Part11 | |
173 | WeldConstraint25.Parent = Part1 | |
174 | WeldConstraint25.Part0 = Part1 | |
175 | WeldConstraint25.Part1 = Part14 | |
176 | Script26.Name = "SwordScript" | |
177 | Script26.Parent = Tool0 | |
178 | table.insert(cors,sandbox(Script26,function() | |
179 | --Rescripted by Luckymaxer | |
180 | --EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl | |
181 | --Updated for R15 avatars by StarWars | |
182 | --Re-updated by TakeoHonorable | |
183 | ||
184 | Tool = script.Parent | |
185 | Handle = Tool:WaitForChild("Handle") | |
186 | ||
187 | function Create(ty) | |
188 | return function(data) | |
189 | local obj = Instance.new(ty) | |
190 | for k, v in pairs(data) do | |
191 | if type(k) == 'number' then | |
192 | v.Parent = obj | |
193 | else | |
194 | obj[k] = v | |
195 | end | |
196 | end | |
197 | return obj | |
198 | end | |
199 | end | |
200 | ||
201 | local BaseUrl = "rbxassetid://" | |
202 | ||
203 | Players = game:GetService("Players") | |
204 | Debris = game:GetService("Debris") | |
205 | RunService = game:GetService("RunService") | |
206 | ||
207 | DamageValues = { | |
208 | BaseDamage = 5, | |
209 | SlashDamage = 10, | |
210 | LungeDamage = 30 | |
211 | } | |
212 | ||
213 | --For R15 avatars | |
214 | Animations = { | |
215 | R15Slash = 522635514, | |
216 | R15Lunge = 522638767 | |
217 | } | |
218 | ||
219 | Damage = DamageValues.BaseDamage | |
220 | ||
221 | Grips = { | |
222 | Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0), | |
223 | Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1) | |
224 | } | |
225 | ||
226 | Sounds = { | |
227 | Slash = Handle:WaitForChild("SwordSlash"), | |
228 | Lunge = Handle:WaitForChild("SwordLunge"), | |
229 | Unsheath = Handle:WaitForChild("Unsheath") | |
230 | } | |
231 | ||
232 | ToolEquipped = false | |
233 | ||
234 | --For Omega Rainbow Katana thumbnail to display a lot of particles. | |
235 | for i, v in pairs(Handle:GetChildren()) do | |
236 | if v:IsA("ParticleEmitter") then | |
237 | v.Rate = 20 | |
238 | end | |
239 | end | |
240 | ||
241 | Tool.Grip = Grips.Up | |
242 | Tool.Enabled = true | |
243 | ||
244 | function IsTeamMate(Player1, Player2) | |
245 | return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) | |
246 | end | |
247 | ||
248 | function TagHumanoid(humanoid, player) | |
249 | local Creator_Tag = Instance.new("ObjectValue") | |
250 | Creator_Tag.Name = "creator" | |
251 | Creator_Tag.Value = player | |
252 | Debris:AddItem(Creator_Tag, 2) | |
253 | Creator_Tag.Parent = humanoid | |
254 | end | |
255 | ||
256 | function UntagHumanoid(humanoid) | |
257 | for i, v in pairs(humanoid:GetChildren()) do | |
258 | if v:IsA("ObjectValue") and v.Name == "creator" then | |
259 | v:Destroy() | |
260 | end | |
261 | end | |
262 | end | |
263 | ||
264 | function Blow(Hit) | |
265 | if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then | |
266 | return | |
267 | end | |
268 | local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") | |
269 | if not RightArm then | |
270 | return | |
271 | end | |
272 | local RightGrip = RightArm:FindFirstChild("RightGrip") | |
273 | if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then | |
274 | return | |
275 | end | |
276 | local character = Hit.Parent | |
277 | if character == Character then | |
278 | return | |
279 | end | |
280 | local humanoid = character:FindFirstChildOfClass("Humanoid") | |
281 | if not humanoid or humanoid.Health == 0 then | |
282 | return | |
283 | end | |
284 | local player = Players:GetPlayerFromCharacter(character) | |
285 | if player and (player == Player or IsTeamMate(Player, player)) then | |
286 | return | |
287 | end | |
288 | UntagHumanoid(humanoid) | |
289 | TagHumanoid(humanoid, Player) | |
290 | humanoid:TakeDamage(Damage) | |
291 | end | |
292 | ||
293 | ||
294 | function Attack() | |
295 | Damage = DamageValues.SlashDamage | |
296 | Sounds.Slash:Play() | |
297 | ||
298 | if Humanoid then | |
299 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
300 | local Anim = Instance.new("StringValue") | |
301 | Anim.Name = "toolanim" | |
302 | Anim.Value = "Slash" | |
303 | Anim.Parent = Tool | |
304 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
305 | local Anim = Tool:FindFirstChild("R15Slash") | |
306 | if Anim then | |
307 | local Track = Humanoid:LoadAnimation(Anim) | |
308 | Track:Play(0) | |
309 | end | |
310 | end | |
311 | end | |
312 | end | |
313 | ||
314 | function Lunge() | |
315 | Damage = DamageValues.LungeDamage | |
316 | ||
317 | Sounds.Lunge:Play() | |
318 | ||
319 | if Humanoid then | |
320 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
321 | local Anim = Instance.new("StringValue") | |
322 | Anim.Name = "toolanim" | |
323 | Anim.Value = "Lunge" | |
324 | Anim.Parent = Tool | |
325 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
326 | local Anim = Tool:FindFirstChild("R15Lunge") | |
327 | if Anim then | |
328 | local Track = Humanoid:LoadAnimation(Anim) | |
329 | Track:Play(0) | |
330 | end | |
331 | end | |
332 | end | |
333 | --[[ | |
334 | if CheckIfAlive() then | |
335 | local Force = Instance.new("BodyVelocity") | |
336 | Force.velocity = Vector3.new(0, 10, 0) | |
337 | Force.maxForce = Vector3.new(0, 4000, 0) | |
338 | Debris:AddItem(Force, 0.4) | |
339 | Force.Parent = Torso | |
340 | end | |
341 | ]] | |
342 | ||
343 | wait(0.2) | |
344 | Tool.Grip = Grips.Out | |
345 | wait(0.6) | |
346 | Tool.Grip = Grips.Up | |
347 | ||
348 | Damage = DamageValues.SlashDamage | |
349 | end | |
350 | ||
351 | Tool.Enabled = true | |
352 | LastAttack = 0 | |
353 | ||
354 | function Activated() | |
355 | if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then | |
356 | return | |
357 | end | |
358 | Tool.Enabled = false | |
359 | local Tick = RunService.Stepped:wait() | |
360 | if (Tick - LastAttack < 0.2) then | |
361 | Lunge() | |
362 | else | |
363 | Attack() | |
364 | end | |
365 | LastAttack = Tick | |
366 | --wait(0.5) | |
367 | Damage = DamageValues.BaseDamage | |
368 | local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ | |
369 | Name = "R15Slash", | |
370 | AnimationId = BaseUrl .. Animations.R15Slash, | |
371 | Parent = Tool | |
372 | }) | |
373 | ||
374 | local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ | |
375 | Name = "R15Lunge", | |
376 | AnimationId = BaseUrl .. Animations.R15Lunge, | |
377 | Parent = Tool | |
378 | }) | |
379 | Tool.Enabled = true | |
380 | end | |
381 | ||
382 | function CheckIfAlive() | |
383 | return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false) | |
384 | end | |
385 | ||
386 | function Equipped() | |
387 | Character = Tool.Parent | |
388 | Player = Players:GetPlayerFromCharacter(Character) | |
389 | Humanoid = Character:FindFirstChildOfClass("Humanoid") | |
390 | Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") | |
391 | if not CheckIfAlive() then | |
392 | return | |
393 | end | |
394 | ToolEquipped = true | |
395 | Sounds.Unsheath:Play() | |
396 | end | |
397 | ||
398 | function Unequipped() | |
399 | Tool.Grip = Grips.Up | |
400 | ToolEquipped = false | |
401 | end | |
402 | ||
403 | Tool.Activated:Connect(Activated) | |
404 | Tool.Equipped:Connect(Equipped) | |
405 | Tool.Unequipped:Connect(Unequipped) | |
406 | ||
407 | Connection = Handle.Touched:Connect(Blow) | |
408 | end)) | |
409 | LocalScript27.Name = "MouseIcon" | |
410 | LocalScript27.Parent = Tool0 | |
411 | table.insert(cors,sandbox(LocalScript27,function() | |
412 | --Made by Luckymaxer | |
413 | ||
414 | Mouse_Icon = "rbxasset://textures/GunCursor.png" | |
415 | Reloading_Icon = "rbxasset://textures/GunWaitCursor.png" | |
416 | ||
417 | Tool = script.Parent | |
418 | ||
419 | Mouse = nil | |
420 | ||
421 | function UpdateIcon() | |
422 | if Mouse then | |
423 | Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon | |
424 | end | |
425 | end | |
426 | ||
427 | function OnEquipped(ToolMouse) | |
428 | Mouse = ToolMouse | |
429 | UpdateIcon() | |
430 | end | |
431 | ||
432 | function OnChanged(Property) | |
433 | if Property == "Enabled" then | |
434 | UpdateIcon() | |
435 | end | |
436 | end | |
437 | ||
438 | Tool.Equipped:Connect(OnEquipped) | |
439 | Tool.Changed:Connect(OnChanged) | |
440 | ||
441 | end)) | |
442 | Camera28.Name = "ThumbnailCamera" | |
443 | Camera28.Parent = Tool0 | |
444 | Camera28.CFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143) | |
445 | Camera28.CoordinateFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143) | |
446 | Camera28.Focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
447 | Camera28.focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
448 | for i,v in pairs(mas:GetChildren()) do | |
449 | - | v.Parent = workspace |
449 | + | v.Parent = workspace.Bo_unty |
450 | pcall(function() v:MakeJoints() end) | |
451 | end | |
452 | mas:Destroy() | |
453 | for i,v in pairs(cors) do | |
454 | spawn(function() | |
455 | pcall(v) | |
456 | end) | |
457 | end |