SHOW:
|
|
- or go back to the newest paste.
1 | - | ƒ--Converted with ttyyuu12345's model to script plugin v4 |
1 | + | |
2 | function sandbox(var,func) | |
3 | local env = getfenv(func) | |
4 | local newenv = setmetatable({},{ | |
5 | __index = function(self,k) | |
6 | if k=="script" then | |
7 | return var | |
8 | else | |
9 | return env[k] | |
10 | end | |
11 | end, | |
12 | }) | |
13 | setfenv(func,newenv) | |
14 | return func | |
15 | end | |
16 | cors = {} | |
17 | mas = Instance.new("Model",game:GetService("Lighting")) | |
18 | Tool0 = Instance.new("Tool") | |
19 | Part1 = Instance.new("Part") | |
20 | Sound2 = Instance.new("Sound") | |
21 | Sound3 = Instance.new("Sound") | |
22 | Sound4 = Instance.new("Sound") | |
23 | Part5 = Instance.new("Part") | |
24 | Decal6 = Instance.new("Decal") | |
25 | Decal7 = Instance.new("Decal") | |
26 | Part8 = Instance.new("Part") | |
27 | Decal9 = Instance.new("Decal") | |
28 | Decal10 = Instance.new("Decal") | |
29 | Part11 = Instance.new("Part") | |
30 | Decal12 = Instance.new("Decal") | |
31 | Decal13 = Instance.new("Decal") | |
32 | Part14 = Instance.new("Part") | |
33 | Decal15 = Instance.new("Decal") | |
34 | Decal16 = Instance.new("Decal") | |
35 | PointLight17 = Instance.new("PointLight") | |
36 | Weld18 = Instance.new("Weld") | |
37 | Weld19 = Instance.new("Weld") | |
38 | Weld20 = Instance.new("Weld") | |
39 | Weld21 = Instance.new("Weld") | |
40 | WeldConstraint22 = Instance.new("WeldConstraint") | |
41 | WeldConstraint23 = Instance.new("WeldConstraint") | |
42 | WeldConstraint24 = Instance.new("WeldConstraint") | |
43 | WeldConstraint25 = Instance.new("WeldConstraint") | |
44 | Script26 = Instance.new("Script") | |
45 | LocalScript27 = Instance.new("LocalScript") | |
46 | Camera28 = Instance.new("Camera") | |
47 | Script29 = Instance.new("Script") | |
48 | Tool0.Name = "Rift" | |
49 | Tool0.Parent = mas | |
50 | Tool0.TextureId = "rbxasset://Textures/Sword128.png" | |
51 | Tool0.Grip = CFrame.new(-0.0215187073, 0, 0.249089241, 0, 0, 1, 1, 0, 0, 0, 1, 0) | |
52 | Tool0.GripForward = Vector3.new(-1, -0, -0) | |
53 | Tool0.GripPos = Vector3.new(-0.0215187073, 0, 0.249089241) | |
54 | Tool0.GripRight = Vector3.new(0, 1, 0) | |
55 | Tool0.GripUp = Vector3.new(0, 0, 1) | |
56 | Part1.Name = "Handle" | |
57 | Part1.Parent = Tool0 | |
58 | 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) | |
59 | Part1.Orientation = Vector3.new(-90, 90, 0) | |
60 | Part1.Position = Vector3.new(-9.39999962, 2.00000095, -9.50000095) | |
61 | Part1.Rotation = Vector3.new(-90, 0, 90) | |
62 | Part1.Color = Color3.new(0.388235, 0.372549, 0.384314) | |
63 | Part1.Transparency = 1 | |
64 | Part1.Size = Vector3.new(1, 0.800000012, 4) | |
65 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
66 | Part1.BrickColor = BrickColor.new("Dark stone grey") | |
67 | Part1.Locked = true | |
68 | Part1.Reflectance = 0.40000000596046 | |
69 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
70 | Part1.brickColor = BrickColor.new("Dark stone grey") | |
71 | Part1.FormFactor = Enum.FormFactor.Plate | |
72 | Part1.formFactor = Enum.FormFactor.Plate | |
73 | Sound2.Name = "SwordSlash" | |
74 | Sound2.Parent = Part1 | |
75 | Sound2.SoundId = "rbxassetid://2571935805" | |
76 | Sound2.Volume = 5 | |
77 | Sound3.Name = "SwordLunge" | |
78 | Sound3.Parent = Part1 | |
79 | Sound3.SoundId = "rbxassetid://1759712659" | |
80 | Sound3.Volume = 5 | |
81 | Sound4.Name = "Unsheath" | |
82 | Sound4.Parent = Part1 | |
83 | Sound4.Looped = true | |
84 | Sound4.SoundId = "rbxassetid://2241931437" | |
85 | Sound4.Volume = 1 | |
86 | Part5.Parent = Part1 | |
87 | Part5.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
88 | Part5.Orientation = Vector3.new(0, -90, 0) | |
89 | Part5.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
90 | Part5.Rotation = Vector3.new(0, -90, 0) | |
91 | Part5.Transparency = 100 | |
92 | Part5.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
93 | Part5.BottomSurface = Enum.SurfaceType.Smooth | |
94 | Part5.CanCollide = false | |
95 | Part5.TopSurface = Enum.SurfaceType.Smooth | |
96 | Decal6.Parent = Part5 | |
97 | Decal6.Texture = "rbxassetid://2171273825" | |
98 | Decal7.Parent = Part5 | |
99 | Decal7.Texture = "rbxassetid://2171273825" | |
100 | Decal7.Face = Enum.NormalId.Back | |
101 | Part8.Parent = Part1 | |
102 | Part8.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
103 | Part8.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
104 | Part8.Transparency = 100 | |
105 | Part8.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
106 | Part8.BottomSurface = Enum.SurfaceType.Smooth | |
107 | Part8.CanCollide = false | |
108 | Part8.TopSurface = Enum.SurfaceType.Smooth | |
109 | Decal9.Parent = Part8 | |
110 | Decal9.Texture = "rbxassetid://2171273825" | |
111 | Decal10.Parent = Part8 | |
112 | Decal10.Texture = "rbxassetid://2171273825" | |
113 | Decal10.Face = Enum.NormalId.Back | |
114 | Part11.Parent = Part1 | |
115 | Part11.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, -0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, -0.707106829) | |
116 | Part11.Orientation = Vector3.new(0, -135, 0) | |
117 | Part11.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
118 | Part11.Rotation = Vector3.new(-180, -45, -180) | |
119 | Part11.Transparency = 100 | |
120 | Part11.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
121 | Part11.BottomSurface = Enum.SurfaceType.Smooth | |
122 | Part11.CanCollide = false | |
123 | Part11.TopSurface = Enum.SurfaceType.Smooth | |
124 | Decal12.Parent = Part11 | |
125 | Decal12.Texture = "rbxassetid://2171273825" | |
126 | Decal13.Parent = Part11 | |
127 | Decal13.Texture = "rbxassetid://2171273825" | |
128 | Decal13.Face = Enum.NormalId.Back | |
129 | Part14.Parent = Part1 | |
130 | Part14.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
131 | Part14.Orientation = Vector3.new(0, -45, 0) | |
132 | Part14.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
133 | Part14.Rotation = Vector3.new(0, -45, 0) | |
134 | Part14.Transparency = 100 | |
135 | Part14.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
136 | Part14.BottomSurface = Enum.SurfaceType.Smooth | |
137 | Part14.CanCollide = false | |
138 | Part14.TopSurface = Enum.SurfaceType.Smooth | |
139 | Decal15.Parent = Part14 | |
140 | Decal15.Texture = "rbxassetid://2171273825" | |
141 | Decal16.Parent = Part14 | |
142 | Decal16.Texture = "rbxassetid://2171273825" | |
143 | Decal16.Face = Enum.NormalId.Back | |
144 | PointLight17.Parent = Part14 | |
145 | PointLight17.Range = 40 | |
146 | Weld18.Parent = Part14 | |
147 | 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) | |
148 | Weld18.Part0 = Part14 | |
149 | Weld18.Part1 = Part1 | |
150 | Weld18.part1 = Part1 | |
151 | Weld19.Parent = Part14 | |
152 | Weld19.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, 0.707106829, 0, 1, 0, -0.707106829, 0, 0.707106829) | |
153 | Weld19.Part0 = Part14 | |
154 | Weld19.Part1 = Part5 | |
155 | Weld19.part1 = Part5 | |
156 | Weld20.Parent = Part14 | |
157 | Weld20.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
158 | Weld20.Part0 = Part14 | |
159 | Weld20.Part1 = Part8 | |
160 | Weld20.part1 = Part8 | |
161 | Weld21.Parent = Part14 | |
162 | Weld21.C1 = CFrame.new(0, 0, 0, 0, 0, 1.00000012, 0, 1, 0, -1.00000012, 0, 0) | |
163 | Weld21.Part0 = Part14 | |
164 | Weld21.Part1 = Part11 | |
165 | Weld21.part1 = Part11 | |
166 | WeldConstraint22.Parent = Part1 | |
167 | WeldConstraint22.Part0 = Part1 | |
168 | WeldConstraint22.Part1 = Part5 | |
169 | WeldConstraint23.Parent = Part1 | |
170 | WeldConstraint23.Part0 = Part1 | |
171 | WeldConstraint23.Part1 = Part8 | |
172 | WeldConstraint24.Parent = Part1 | |
173 | WeldConstraint24.Part0 = Part1 | |
174 | WeldConstraint24.Part1 = Part11 | |
175 | WeldConstraint25.Parent = Part1 | |
176 | WeldConstraint25.Part0 = Part1 | |
177 | WeldConstraint25.Part1 = Part14 | |
178 | Script26.Name = "SwordScript" | |
179 | Script26.Parent = Tool0 | |
180 | table.insert(cors,sandbox(Script26,function() | |
181 | --Rescripted by Luckymaxer | |
182 | --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 | |
183 | --Updated for R15 avatars by StarWars | |
184 | --Re-updated by TakeoHonorable | |
185 | ||
186 | Tool = script.Parent | |
187 | Handle = Tool:WaitForChild("Handle") | |
188 | ||
189 | function Create(ty) | |
190 | return function(data) | |
191 | local obj = Instance.new(ty) | |
192 | for k, v in pairs(data) do | |
193 | if type(k) == 'number' then | |
194 | v.Parent = obj | |
195 | else | |
196 | obj[k] = v | |
197 | end | |
198 | end | |
199 | return obj | |
200 | end | |
201 | end | |
202 | ||
203 | local BaseUrl = "rbxassetid://" | |
204 | ||
205 | Players = game:GetService("Players") | |
206 | Debris = game:GetService("Debris") | |
207 | RunService = game:GetService("RunService") | |
208 | ||
209 | DamageValues = { | |
210 | BaseDamage = 5, | |
211 | SlashDamage = 10, | |
212 | LungeDamage = 30 | |
213 | } | |
214 | ||
215 | --For R15 avatars | |
216 | Animations = { | |
217 | R15Slash = 522635514, | |
218 | R15Lunge = 522638767 | |
219 | } | |
220 | ||
221 | Damage = DamageValues.BaseDamage | |
222 | ||
223 | Grips = { | |
224 | Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0), | |
225 | Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1) | |
226 | } | |
227 | ||
228 | Sounds = { | |
229 | Slash = Handle:WaitForChild("SwordSlash"), | |
230 | Lunge = Handle:WaitForChild("SwordLunge"), | |
231 | Unsheath = Handle:WaitForChild("Unsheath") | |
232 | } | |
233 | ||
234 | ToolEquipped = false | |
235 | ||
236 | --For Omega Rainbow Katana thumbnail to display a lot of particles. | |
237 | for i, v in pairs(Handle:GetChildren()) do | |
238 | if v:IsA("ParticleEmitter") then | |
239 | v.Rate = 20 | |
240 | end | |
241 | end | |
242 | ||
243 | Tool.Grip = Grips.Up | |
244 | Tool.Enabled = true | |
245 | ||
246 | function IsTeamMate(Player1, Player2) | |
247 | return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) | |
248 | end | |
249 | ||
250 | function TagHumanoid(humanoid, player) | |
251 | local Creator_Tag = Instance.new("ObjectValue") | |
252 | Creator_Tag.Name = "creator" | |
253 | Creator_Tag.Value = player | |
254 | Debris:AddItem(Creator_Tag, 2) | |
255 | Creator_Tag.Parent = humanoid | |
256 | end | |
257 | ||
258 | function UntagHumanoid(humanoid) | |
259 | for i, v in pairs(humanoid:GetChildren()) do | |
260 | if v:IsA("ObjectValue") and v.Name == "creator" then | |
261 | v:Destroy() | |
262 | end | |
263 | end | |
264 | end | |
265 | ||
266 | function Blow(Hit) | |
267 | if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then | |
268 | return | |
269 | end | |
270 | local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") | |
271 | if not RightArm then | |
272 | return | |
273 | end | |
274 | local RightGrip = RightArm:FindFirstChild("RightGrip") | |
275 | if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then | |
276 | return | |
277 | end | |
278 | local character = Hit.Parent | |
279 | if character == Character then | |
280 | return | |
281 | end | |
282 | local humanoid = character:FindFirstChildOfClass("Humanoid") | |
283 | if not humanoid or humanoid.Health == 0 then | |
284 | return | |
285 | end | |
286 | local player = Players:GetPlayerFromCharacter(character) | |
287 | if player and (player == Player or IsTeamMate(Player, player)) then | |
288 | return | |
289 | end | |
290 | UntagHumanoid(humanoid) | |
291 | TagHumanoid(humanoid, Player) | |
292 | humanoid:TakeDamage(Damage) | |
293 | end | |
294 | ||
295 | ||
296 | function Attack() | |
297 | Damage = DamageValues.SlashDamage | |
298 | Sounds.Slash:Play() | |
299 | ||
300 | if Humanoid then | |
301 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
302 | local Anim = Instance.new("StringValue") | |
303 | Anim.Name = "toolanim" | |
304 | Anim.Value = "Slash" | |
305 | Anim.Parent = Tool | |
306 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
307 | local Anim = Tool:FindFirstChild("R15Slash") | |
308 | if Anim then | |
309 | local Track = Humanoid:LoadAnimation(Anim) | |
310 | Track:Play(0) | |
311 | end | |
312 | end | |
313 | end | |
314 | end | |
315 | ||
316 | function Lunge() | |
317 | Damage = DamageValues.LungeDamage | |
318 | ||
319 | Sounds.Lunge:Play() | |
320 | ||
321 | if Humanoid then | |
322 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
323 | local Anim = Instance.new("StringValue") | |
324 | Anim.Name = "toolanim" | |
325 | Anim.Value = "Lunge" | |
326 | Anim.Parent = Tool | |
327 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
328 | local Anim = Tool:FindFirstChild("R15Lunge") | |
329 | if Anim then | |
330 | local Track = Humanoid:LoadAnimation(Anim) | |
331 | Track:Play(0) | |
332 | end | |
333 | end | |
334 | end | |
335 | --[[ | |
336 | if CheckIfAlive() then | |
337 | local Force = Instance.new("BodyVelocity") | |
338 | Force.velocity = Vector3.new(0, 10, 0) | |
339 | Force.maxForce = Vector3.new(0, 4000, 0) | |
340 | Debris:AddItem(Force, 0.4) | |
341 | Force.Parent = Torso | |
342 | end | |
343 | ]] | |
344 | ||
345 | wait(0.2) | |
346 | Tool.Grip = Grips.Out | |
347 | wait(0.6) | |
348 | Tool.Grip = Grips.Up | |
349 | ||
350 | Damage = DamageValues.SlashDamage | |
351 | end | |
352 | ||
353 | Tool.Enabled = true | |
354 | LastAttack = 0 | |
355 | ||
356 | function Activated() | |
357 | if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then | |
358 | return | |
359 | end | |
360 | Tool.Enabled = false | |
361 | local Tick = RunService.Stepped:wait() | |
362 | if (Tick - LastAttack < 0.2) then | |
363 | Lunge() | |
364 | else | |
365 | Attack() | |
366 | end | |
367 | LastAttack = Tick | |
368 | --wait(0.5) | |
369 | Damage = DamageValues.BaseDamage | |
370 | local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ | |
371 | Name = "R15Slash", | |
372 | AnimationId = BaseUrl .. Animations.R15Slash, | |
373 | Parent = Tool | |
374 | }) | |
375 | ||
376 | local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ | |
377 | Name = "R15Lunge", | |
378 | AnimationId = BaseUrl .. Animations.R15Lunge, | |
379 | Parent = Tool | |
380 | }) | |
381 | Tool.Enabled = true | |
382 | end | |
383 | ||
384 | function CheckIfAlive() | |
385 | 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) | |
386 | end | |
387 | ||
388 | function Equipped() | |
389 | Character = Tool.Parent | |
390 | Player = Players:GetPlayerFromCharacter(Character) | |
391 | Humanoid = Character:FindFirstChildOfClass("Humanoid") | |
392 | Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") | |
393 | if not CheckIfAlive() then | |
394 | return | |
395 | end | |
396 | ToolEquipped = true | |
397 | Sounds.Unsheath:Play() | |
398 | end | |
399 | ||
400 | function Unequipped() | |
401 | Tool.Grip = Grips.Up | |
402 | ToolEquipped = false | |
403 | end | |
404 | ||
405 | Tool.Activated:Connect(Activated) | |
406 | Tool.Equipped:Connect(Equipped) | |
407 | Tool.Unequipped:Connect(Unequipped) | |
408 | ||
409 | Connection = Handle.Touched:Connect(Blow) | |
410 | end)) | |
411 | LocalScript27.Name = "MouseIcon" | |
412 | LocalScript27.Parent = Tool0 | |
413 | table.insert(cors,sandbox(LocalScript27,function() | |
414 | --Made by Luckymaxer | |
415 | ||
416 | Mouse_Icon = "rbxasset://textures/GunCursor.png" | |
417 | Reloading_Icon = "rbxasset://textures/GunWaitCursor.png" | |
418 | ||
419 | Tool = script.Parent | |
420 | ||
421 | Mouse = nil | |
422 | ||
423 | function UpdateIcon() | |
424 | if Mouse then | |
425 | Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon | |
426 | end | |
427 | end | |
428 | ||
429 | function OnEquipped(ToolMouse) | |
430 | Mouse = ToolMouse | |
431 | UpdateIcon() | |
432 | end | |
433 | ||
434 | function OnChanged(Property) | |
435 | if Property == "Enabled" then | |
436 | UpdateIcon() | |
437 | end | |
438 | end | |
439 | ||
440 | Tool.Equipped:Connect(OnEquipped) | |
441 | Tool.Changed:Connect(OnChanged) | |
442 | ||
443 | end)) | |
444 | Camera28.Name = "ThumbnailCamera" | |
445 | Camera28.Parent = Tool0 | |
446 | 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) | |
447 | 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) | |
448 | Camera28.Focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
449 | Camera28.focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
450 | Script29.Name = "WalkSpeedScript" | |
451 | Script29.Parent = Tool0 | |
452 | table.insert(cors,sandbox(Script29,function() | |
453 | speed = 100 --16 is default | |
454 | ||
455 | function onPlayerRespawned(character) | |
456 | wait(1) --loading delay | |
457 | local player = game.Players:GetPlayerFromCharacter(character) | |
458 | local human = character:findFirstChild("Humanoid") | |
459 | if player ~= nil and human ~= nil then | |
460 | human.WalkSpeed = speed | |
461 | end | |
462 | end | |
463 | ||
464 | game.Workspace.ChildAdded:connect(onPlayerRespawned) | |
465 | ||
466 | end)) | |
467 | for i,v in pairs(mas:GetChildren()) do | |
468 | v.Parent = workspace | |
469 | pcall(function() v:MakeJoints() end) | |
470 | end | |
471 | mas:Destroy() | |
472 | for i,v in pairs(cors) do | |
473 | spawn(function() | |
474 | pcall(v) | |
475 | end) | |
476 | end | |
477 | ||
478 | --Converted with ttyyuu12345's model to script plugin v4 | |
479 | function sandbox(var,func) | |
480 | local env = getfenv(func) | |
481 | local newenv = setmetatable({},{ | |
482 | __index = function(self,k) | |
483 | if k=="script" then | |
484 | return var | |
485 | else | |
486 | return env[k] | |
487 | end | |
488 | end, | |
489 | }) | |
490 | setfenv(func,newenv) | |
491 | return func | |
492 | end | |
493 | cors = {} | |
494 | mas = Instance.new("Model",game:GetService("Lighting")) | |
495 | Tool0 = Instance.new("Tool") | |
496 | Part1 = Instance.new("Part") | |
497 | Sound2 = Instance.new("Sound") | |
498 | Sound3 = Instance.new("Sound") | |
499 | Sound4 = Instance.new("Sound") | |
500 | Part5 = Instance.new("Part") | |
501 | Decal6 = Instance.new("Decal") | |
502 | Decal7 = Instance.new("Decal") | |
503 | Part8 = Instance.new("Part") | |
504 | Decal9 = Instance.new("Decal") | |
505 | Decal10 = Instance.new("Decal") | |
506 | Part11 = Instance.new("Part") | |
507 | Decal12 = Instance.new("Decal") | |
508 | Decal13 = Instance.new("Decal") | |
509 | Part14 = Instance.new("Part") | |
510 | Decal15 = Instance.new("Decal") | |
511 | Decal16 = Instance.new("Decal") | |
512 | PointLight17 = Instance.new("PointLight") | |
513 | Weld18 = Instance.new("Weld") | |
514 | Weld19 = Instance.new("Weld") | |
515 | Weld20 = Instance.new("Weld") | |
516 | Weld21 = Instance.new("Weld") | |
517 | WeldConstraint22 = Instance.new("WeldConstraint") | |
518 | WeldConstraint23 = Instance.new("WeldConstraint") | |
519 | WeldConstraint24 = Instance.new("WeldConstraint") | |
520 | WeldConstraint25 = Instance.new("WeldConstraint") | |
521 | Script26 = Instance.new("Script") | |
522 | LocalScript27 = Instance.new("LocalScript") | |
523 | Camera28 = Instance.new("Camera") | |
524 | Script29 = Instance.new("Script") | |
525 | Tool0.Name = "Rift" | |
526 | Tool0.Parent = mas | |
527 | Tool0.TextureId = "rbxasset://Textures/Sword128.png" | |
528 | Tool0.Grip = CFrame.new(-0.0215187073, 0, 0.249089241, 0, 0, 1, 1, 0, 0, 0, 1, 0) | |
529 | Tool0.GripForward = Vector3.new(-1, -0, -0) | |
530 | Tool0.GripPos = Vector3.new(-0.0215187073, 0, 0.249089241) | |
531 | Tool0.GripRight = Vector3.new(0, 1, 0) | |
532 | Tool0.GripUp = Vector3.new(0, 0, 1) | |
533 | Part1.Name = "Handle" | |
534 | Part1.Parent = Tool0 | |
535 | 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) | |
536 | Part1.Orientation = Vector3.new(-90, 90, 0) | |
537 | Part1.Position = Vector3.new(-9.39999962, 2.00000095, -9.50000095) | |
538 | Part1.Rotation = Vector3.new(-90, 0, 90) | |
539 | Part1.Color = Color3.new(0.388235, 0.372549, 0.384314) | |
540 | Part1.Transparency = 1 | |
541 | Part1.Size = Vector3.new(1, 0.800000012, 4) | |
542 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
543 | Part1.BrickColor = BrickColor.new("Dark stone grey") | |
544 | Part1.Locked = true | |
545 | Part1.Reflectance = 0.40000000596046 | |
546 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
547 | Part1.brickColor = BrickColor.new("Dark stone grey") | |
548 | Part1.FormFactor = Enum.FormFactor.Plate | |
549 | Part1.formFactor = Enum.FormFactor.Plate | |
550 | Sound2.Name = "SwordSlash" | |
551 | Sound2.Parent = Part1 | |
552 | Sound2.SoundId = "rbxassetid://2571935805" | |
553 | Sound2.Volume = 5 | |
554 | Sound3.Name = "SwordLunge" | |
555 | Sound3.Parent = Part1 | |
556 | Sound3.SoundId = "rbxassetid://1759712659" | |
557 | Sound3.Volume = 5 | |
558 | Sound4.Name = "Unsheath" | |
559 | Sound4.Parent = Part1 | |
560 | Sound4.Looped = true | |
561 | Sound4.SoundId = "rbxassetid://2241931437" | |
562 | Sound4.Volume = 1 | |
563 | Part5.Parent = Part1 | |
564 | Part5.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
565 | Part5.Orientation = Vector3.new(0, -90, 0) | |
566 | Part5.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
567 | Part5.Rotation = Vector3.new(0, -90, 0) | |
568 | Part5.Transparency = 100 | |
569 | Part5.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
570 | Part5.BottomSurface = Enum.SurfaceType.Smooth | |
571 | Part5.CanCollide = false | |
572 | Part5.TopSurface = Enum.SurfaceType.Smooth | |
573 | Decal6.Parent = Part5 | |
574 | Decal6.Texture = "rbxassetid://2171273825" | |
575 | Decal7.Parent = Part5 | |
576 | Decal7.Texture = "rbxassetid://2171273825" | |
577 | Decal7.Face = Enum.NormalId.Back | |
578 | Part8.Parent = Part1 | |
579 | Part8.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
580 | Part8.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
581 | Part8.Transparency = 100 | |
582 | Part8.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
583 | Part8.BottomSurface = Enum.SurfaceType.Smooth | |
584 | Part8.CanCollide = false | |
585 | Part8.TopSurface = Enum.SurfaceType.Smooth | |
586 | Decal9.Parent = Part8 | |
587 | Decal9.Texture = "rbxassetid://2171273825" | |
588 | Decal10.Parent = Part8 | |
589 | Decal10.Texture = "rbxassetid://2171273825" | |
590 | Decal10.Face = Enum.NormalId.Back | |
591 | Part11.Parent = Part1 | |
592 | Part11.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, -0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, -0.707106829) | |
593 | Part11.Orientation = Vector3.new(0, -135, 0) | |
594 | Part11.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
595 | Part11.Rotation = Vector3.new(-180, -45, -180) | |
596 | Part11.Transparency = 100 | |
597 | Part11.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
598 | Part11.BottomSurface = Enum.SurfaceType.Smooth | |
599 | Part11.CanCollide = false | |
600 | Part11.TopSurface = Enum.SurfaceType.Smooth | |
601 | Decal12.Parent = Part11 | |
602 | Decal12.Texture = "rbxassetid://2171273825" | |
603 | Decal13.Parent = Part11 | |
604 | Decal13.Texture = "rbxassetid://2171273825" | |
605 | Decal13.Face = Enum.NormalId.Back | |
606 | Part14.Parent = Part1 | |
607 | Part14.CFrame = CFrame.new(-9.46000004, 2.05503607, -9.44498158, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
608 | Part14.Orientation = Vector3.new(0, -45, 0) | |
609 | Part14.Position = Vector3.new(-9.46000004, 2.05503607, -9.44498158) | |
610 | Part14.Rotation = Vector3.new(0, -45, 0) | |
611 | Part14.Transparency = 100 | |
612 | Part14.Size = Vector3.new(4, 4.10999966, 0.0500000007) | |
613 | Part14.BottomSurface = Enum.SurfaceType.Smooth | |
614 | Part14.CanCollide = false | |
615 | Part14.TopSurface = Enum.SurfaceType.Smooth | |
616 | Decal15.Parent = Part14 | |
617 | Decal15.Texture = "rbxassetid://2171273825" | |
618 | Decal16.Parent = Part14 | |
619 | Decal16.Texture = "rbxassetid://2171273825" | |
620 | Decal16.Face = Enum.NormalId.Back | |
621 | PointLight17.Parent = Part14 | |
622 | PointLight17.Range = 40 | |
623 | Weld18.Parent = Part14 | |
624 | 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) | |
625 | Weld18.Part0 = Part14 | |
626 | Weld18.Part1 = Part1 | |
627 | Weld18.part1 = Part1 | |
628 | Weld19.Parent = Part14 | |
629 | Weld19.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, 0.707106829, 0, 1, 0, -0.707106829, 0, 0.707106829) | |
630 | Weld19.Part0 = Part14 | |
631 | Weld19.Part1 = Part5 | |
632 | Weld19.part1 = Part5 | |
633 | Weld20.Parent = Part14 | |
634 | Weld20.C1 = CFrame.new(0, 0, 0, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829) | |
635 | Weld20.Part0 = Part14 | |
636 | Weld20.Part1 = Part8 | |
637 | Weld20.part1 = Part8 | |
638 | Weld21.Parent = Part14 | |
639 | Weld21.C1 = CFrame.new(0, 0, 0, 0, 0, 1.00000012, 0, 1, 0, -1.00000012, 0, 0) | |
640 | Weld21.Part0 = Part14 | |
641 | Weld21.Part1 = Part11 | |
642 | Weld21.part1 = Part11 | |
643 | WeldConstraint22.Parent = Part1 | |
644 | WeldConstraint22.Part0 = Part1 | |
645 | WeldConstraint22.Part1 = Part5 | |
646 | WeldConstraint23.Parent = Part1 | |
647 | WeldConstraint23.Part0 = Part1 | |
648 | WeldConstraint23.Part1 = Part8 | |
649 | WeldConstraint24.Parent = Part1 | |
650 | WeldConstraint24.Part0 = Part1 | |
651 | WeldConstraint24.Part1 = Part11 | |
652 | WeldConstraint25.Parent = Part1 | |
653 | WeldConstraint25.Part0 = Part1 | |
654 | WeldConstraint25.Part1 = Part14 | |
655 | Script26.Name = "SwordScript" | |
656 | Script26.Parent = Tool0 | |
657 | table.insert(cors,sandbox(Script26,function() | |
658 | --Rescripted by Luckymaxer | |
659 | --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 | |
660 | --Updated for R15 avatars by StarWars | |
661 | --Re-updated by TakeoHonorable | |
662 | ||
663 | Tool = script.Parent | |
664 | Handle = Tool:WaitForChild("Handle") | |
665 | ||
666 | function Create(ty) | |
667 | return function(data) | |
668 | local obj = Instance.new(ty) | |
669 | for k, v in pairs(data) do | |
670 | if type(k) == 'number' then | |
671 | v.Parent = obj | |
672 | else | |
673 | obj[k] = v | |
674 | end | |
675 | end | |
676 | return obj | |
677 | end | |
678 | end | |
679 | ||
680 | local BaseUrl = "rbxassetid://" | |
681 | ||
682 | Players = game:GetService("Players") | |
683 | Debris = game:GetService("Debris") | |
684 | RunService = game:GetService("RunService") | |
685 | ||
686 | DamageValues = { | |
687 | BaseDamage = 5, | |
688 | SlashDamage = 10, | |
689 | LungeDamage = 30 | |
690 | } | |
691 | ||
692 | --For R15 avatars | |
693 | Animations = { | |
694 | R15Slash = 522635514, | |
695 | R15Lunge = 522638767 | |
696 | } | |
697 | ||
698 | Damage = DamageValues.BaseDamage | |
699 | ||
700 | Grips = { | |
701 | Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0), | |
702 | Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1) | |
703 | } | |
704 | ||
705 | Sounds = { | |
706 | Slash = Handle:WaitForChild("SwordSlash"), | |
707 | Lunge = Handle:WaitForChild("SwordLunge"), | |
708 | Unsheath = Handle:WaitForChild("Unsheath") | |
709 | } | |
710 | ||
711 | ToolEquipped = false | |
712 | ||
713 | --For Omega Rainbow Katana thumbnail to display a lot of particles. | |
714 | for i, v in pairs(Handle:GetChildren()) do | |
715 | if v:IsA("ParticleEmitter") then | |
716 | v.Rate = 20 | |
717 | end | |
718 | end | |
719 | ||
720 | Tool.Grip = Grips.Up | |
721 | Tool.Enabled = true | |
722 | ||
723 | function IsTeamMate(Player1, Player2) | |
724 | return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) | |
725 | end | |
726 | ||
727 | function TagHumanoid(humanoid, player) | |
728 | local Creator_Tag = Instance.new("ObjectValue") | |
729 | Creator_Tag.Name = "creator" | |
730 | Creator_Tag.Value = player | |
731 | Debris:AddItem(Creator_Tag, 2) | |
732 | Creator_Tag.Parent = humanoid | |
733 | end | |
734 | ||
735 | function UntagHumanoid(humanoid) | |
736 | for i, v in pairs(humanoid:GetChildren()) do | |
737 | if v:IsA("ObjectValue") and v.Name == "creator" then | |
738 | v:Destroy() | |
739 | end | |
740 | end | |
741 | end | |
742 | ||
743 | function Blow(Hit) | |
744 | if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then | |
745 | return | |
746 | end | |
747 | local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") | |
748 | if not RightArm then | |
749 | return | |
750 | end | |
751 | local RightGrip = RightArm:FindFirstChild("RightGrip") | |
752 | if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then | |
753 | return | |
754 | end | |
755 | local character = Hit.Parent | |
756 | if character == Character then | |
757 | return | |
758 | end | |
759 | local humanoid = character:FindFirstChildOfClass("Humanoid") | |
760 | if not humanoid or humanoid.Health == 0 then | |
761 | return | |
762 | end | |
763 | local player = Players:GetPlayerFromCharacter(character) | |
764 | if player and (player == Player or IsTeamMate(Player, player)) then | |
765 | return | |
766 | end | |
767 | UntagHumanoid(humanoid) | |
768 | TagHumanoid(humanoid, Player) | |
769 | humanoid:TakeDamage(Damage) | |
770 | end | |
771 | ||
772 | ||
773 | function Attack() | |
774 | Damage = DamageValues.SlashDamage | |
775 | Sounds.Slash:Play() | |
776 | ||
777 | if Humanoid then | |
778 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
779 | local Anim = Instance.new("StringValue") | |
780 | Anim.Name = "toolanim" | |
781 | Anim.Value = "Slash" | |
782 | Anim.Parent = Tool | |
783 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
784 | local Anim = Tool:FindFirstChild("R15Slash") | |
785 | if Anim then | |
786 | local Track = Humanoid:LoadAnimation(Anim) | |
787 | Track:Play(0) | |
788 | end | |
789 | end | |
790 | end | |
791 | end | |
792 | ||
793 | function Lunge() | |
794 | Damage = DamageValues.LungeDamage | |
795 | ||
796 | Sounds.Lunge:Play() | |
797 | ||
798 | if Humanoid then | |
799 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
800 | local Anim = Instance.new("StringValue") | |
801 | Anim.Name = "toolanim" | |
802 | Anim.Value = "Lunge" | |
803 | Anim.Parent = Tool | |
804 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
805 | local Anim = Tool:FindFirstChild("R15Lunge") | |
806 | if Anim then | |
807 | local Track = Humanoid:LoadAnimation(Anim) | |
808 | Track:Play(0) | |
809 | end | |
810 | end | |
811 | end | |
812 | --[[ | |
813 | if CheckIfAlive() then | |
814 | local Force = Instance.new("BodyVelocity") | |
815 | Force.velocity = Vector3.new(0, 10, 0) | |
816 | Force.maxForce = Vector3.new(0, 4000, 0) | |
817 | Debris:AddItem(Force, 0.4) | |
818 | Force.Parent = Torso | |
819 | end | |
820 | ]] | |
821 | ||
822 | wait(0.2) | |
823 | Tool.Grip = Grips.Out | |
824 | wait(0.6) | |
825 | Tool.Grip = Grips.Up | |
826 | ||
827 | Damage = DamageValues.SlashDamage | |
828 | end | |
829 | ||
830 | Tool.Enabled = true | |
831 | LastAttack = 0 | |
832 | ||
833 | function Activated() | |
834 | if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then | |
835 | return | |
836 | end | |
837 | Tool.Enabled = false | |
838 | local Tick = RunService.Stepped:wait() | |
839 | if (Tick - LastAttack < 0.2) then | |
840 | Lunge() | |
841 | else | |
842 | Attack() | |
843 | end | |
844 | LastAttack = Tick | |
845 | --wait(0.5) | |
846 | Damage = DamageValues.BaseDamage | |
847 | local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ | |
848 | Name = "R15Slash", | |
849 | AnimationId = BaseUrl .. Animations.R15Slash, | |
850 | Parent = Tool | |
851 | }) | |
852 | ||
853 | local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ | |
854 | Name = "R15Lunge", | |
855 | AnimationId = BaseUrl .. Animations.R15Lunge, | |
856 | Parent = Tool | |
857 | }) | |
858 | Tool.Enabled = true | |
859 | end | |
860 | ||
861 | function CheckIfAlive() | |
862 | 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) | |
863 | end | |
864 | ||
865 | function Equipped() | |
866 | Character = Tool.Parent | |
867 | Player = Players:GetPlayerFromCharacter(Character) | |
868 | Humanoid = Character:FindFirstChildOfClass("Humanoid") | |
869 | Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") | |
870 | if not CheckIfAlive() then | |
871 | return | |
872 | end | |
873 | ToolEquipped = true | |
874 | Sounds.Unsheath:Play() | |
875 | end | |
876 | ||
877 | function Unequipped() | |
878 | Tool.Grip = Grips.Up | |
879 | ToolEquipped = false | |
880 | end | |
881 | ||
882 | Tool.Activated:Connect(Activated) | |
883 | Tool.Equipped:Connect(Equipped) | |
884 | Tool.Unequipped:Connect(Unequipped) | |
885 | ||
886 | Connection = Handle.Touched:Connect(Blow) | |
887 | end)) | |
888 | LocalScript27.Name = "MouseIcon" | |
889 | LocalScript27.Parent = Tool0 | |
890 | table.insert(cors,sandbox(LocalScript27,function() | |
891 | --Made by Luckymaxer | |
892 | ||
893 | Mouse_Icon = "rbxasset://textures/GunCursor.png" | |
894 | Reloading_Icon = "rbxasset://textures/GunWaitCursor.png" | |
895 | ||
896 | Tool = script.Parent | |
897 | ||
898 | Mouse = nil | |
899 | ||
900 | function UpdateIcon() | |
901 | if Mouse then | |
902 | Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon | |
903 | end | |
904 | end | |
905 | ||
906 | function OnEquipped(ToolMouse) | |
907 | Mouse = ToolMouse | |
908 | UpdateIcon() | |
909 | end | |
910 | ||
911 | function OnChanged(Property) | |
912 | if Property == "Enabled" then | |
913 | UpdateIcon() | |
914 | end | |
915 | end | |
916 | ||
917 | Tool.Equipped:Connect(OnEquipped) | |
918 | Tool.Changed:Connect(OnChanged) | |
919 | ||
920 | end)) | |
921 | Camera28.Name = "ThumbnailCamera" | |
922 | Camera28.Parent = Tool0 | |
923 | 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) | |
924 | 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) | |
925 | Camera28.Focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
926 | Camera28.focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
927 | Script29.Name = "WalkSpeedScript" | |
928 | Script29.Parent = Tool0 | |
929 | table.insert(cors,sandbox(Script29,function() | |
930 | speed = 100 --16 is default | |
931 | ||
932 | function onPlayerRespawned(character) | |
933 | wait(1) --loading delay | |
934 | local player = game.Players:GetPlayerFromCharacter(character) | |
935 | local human = character:findFirstChild("Humanoid") | |
936 | if player ~= nil and human ~= nil then | |
937 | human.WalkSpeed = speed | |
938 | end | |
939 | end | |
940 | ||
941 | game.Workspace.ChildAdded:connect(onPlayerRespawned) | |
942 | ||
943 | end)) | |
944 | for i,v in pairs(mas:GetChildren()) do | |
945 | v.Parent = workspace | |
946 | pcall(function() v:MakeJoints() end) | |
947 | end | |
948 | mas:Destroy() | |
949 | for i,v in pairs(cors) do | |
950 | spawn(function() | |
951 | pcall(v) | |
952 | end) | |
953 | end |