SHOW:
|
|
- or go back to the newest paste.
1 | Tool0 = Instance.new("Tool") | |
2 | Part1 = Instance.new("Part") | |
3 | SpecialMesh2 = Instance.new("SpecialMesh") | |
4 | - | Tool0.Name = "Linked Sword" |
4 | + | Tool0.Name = "Bass Sword" |
5 | - | Tool0.ToolTip = "It slices, it dices. One click to slash, double click to lunge. Lunging does 3x damage." |
5 | + | Tool0.ToolTip = "Made by CoolScripter. Does an good dmg. I made it for my script tho " |
6 | Tool0.Parent = owner.Backpack | |
7 | Tool0.Grip = CFrame.new(0, 0, -1.5) * CFrame.Angles(math.rad(90),math.rad(90),0) | |
8 | - | Tool0.TextureId = 'rbxasset://Textures/Sword128.png' |
8 | + | |
9 | Part1.Parent = Tool0 | |
10 | Part1.Color = Color3.fromRGB(99, 95, 98) | |
11 | Part1.Reflectance = 0.4 | |
12 | Part1.Size = Vector3.new(1, 0.8, 4) | |
13 | local mesh = Instance.new("SpecialMesh" , real) | |
14 | - | SpecialMesh2.Parent = Part1 |
14 | + | mesh.MeshId = 'rbxassetid://1036532801' |
15 | - | SpecialMesh2.MeshId = "rbxasset://fonts/sword.mesh" |
15 | + | mesh.TextureId = 'rbxassetid://1036532816' |
16 | - | SpecialMesh2.Scale = Vector3.new(1,1,1) |
16 | + | mesh.Scale = Vector3.new(.15,.15,.15) |
17 | - | SpecialMesh2.TextureId = "rbxasset://textures/SwordTexture.png" |
17 | + | |
18 | - | SpecialMesh2.MeshType = Enum.MeshType.FileMesh |
18 | + | |
19 | ||
20 | function Create(ty) | |
21 | return function(data) | |
22 | local obj = Instance.new(ty) | |
23 | for k, v in pairs(data) do | |
24 | if type(k) == 'number' then | |
25 | v.Parent = obj | |
26 | else | |
27 | obj[k] = v | |
28 | end | |
29 | end | |
30 | return obj | |
31 | end | |
32 | end | |
33 | ||
34 | local BaseUrl = "rbxassetid://" | |
35 | ||
36 | Players = game:GetService("Players") | |
37 | Debris = game:GetService("Debris") | |
38 | RunService = game:GetService("RunService") | |
39 | ||
40 | DamageValues = { | |
41 | BaseDamage = 5, | |
42 | SlashDamage = 10, | |
43 | LungeDamage = 30 | |
44 | } | |
45 | ||
46 | --For R15 avatars | |
47 | Animations = { | |
48 | R15Slash = 522635514, | |
49 | R15Lunge = 522638767 | |
50 | } | |
51 | ||
52 | Damage = DamageValues.BaseDamage | |
53 | ||
54 | Grips = { | |
55 | Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0), | |
56 | Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1) | |
57 | } | |
58 | Slash = Instance.new("Sound" , owner.Character.Head) | |
59 | Slash.SoundId = 'rbxassetid://138245143' | |
60 | Slash.Pitch = 2 | |
61 | - | Slash.SoundId = 'rbxassetid://12222216' |
61 | + | |
62 | Lunge = Instance.new("Sound" , owner.Character.Head) | |
63 | Lunge.SoundId = 'rbxassetid://138245143' | |
64 | - | Lunge.SoundId = 'rbxassetid://12222208' |
64 | + | Lunge.Pitch = 5.5 |
65 | Lunge.Name = 'SwordLunge' | |
66 | Unsheath = Instance.new("Sound" , owner.Character.Head) | |
67 | - | Unsheath.SoundId = 'rbxassetid://12222225' |
67 | + | Unsheath.SoundId = 'rbxassetid://138245143' |
68 | Unsheath.Name = 'Unsheath' | |
69 | Sounds = { | |
70 | Slash = owner.Character.Head:WaitForChild("SwordSlash"), | |
71 | Lunge = owner.Character.Head:WaitForChild("SwordLunge"), | |
72 | Unsheath = owner.Character.Head:WaitForChild("Unsheath") | |
73 | } | |
74 | ||
75 | ToolEquipped = false | |
76 | ||
77 | --For Omega Rainbow Katana thumbnail to display a lot of particles. | |
78 | for i, v in pairs(Handle:GetChildren()) do | |
79 | if v:IsA("ParticleEmitter") then | |
80 | v.Rate = 20 | |
81 | end | |
82 | end | |
83 | ||
84 | Tool.Grip = Grips.Up | |
85 | Tool.Enabled = true | |
86 | ||
87 | function IsTeamMate(Player1, Player2) | |
88 | return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) | |
89 | end | |
90 | ||
91 | function TagHumanoid(humanoid, player) | |
92 | local Creator_Tag = Instance.new("ObjectValue") | |
93 | Creator_Tag.Name = "creator" | |
94 | Creator_Tag.Value = player | |
95 | Debris:AddItem(Creator_Tag, 2) | |
96 | Creator_Tag.Parent = humanoid | |
97 | end | |
98 | ||
99 | function UntagHumanoid(humanoid) | |
100 | for i, v in pairs(humanoid:GetChildren()) do | |
101 | if v:IsA("ObjectValue") and v.Name == "creator" then | |
102 | v:Destroy() | |
103 | end | |
104 | end | |
105 | end | |
106 | ||
107 | function Blow(Hit) | |
108 | if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then | |
109 | return | |
110 | end | |
111 | local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") | |
112 | if not RightArm then | |
113 | return | |
114 | end | |
115 | local RightGrip = RightArm:FindFirstChild("RightGrip") | |
116 | if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then | |
117 | return | |
118 | end | |
119 | local character = Hit.Parent | |
120 | if character == Character then | |
121 | return | |
122 | end | |
123 | local humanoid = character:FindFirstChildOfClass("Humanoid") | |
124 | if not humanoid or humanoid.Health == 0 then | |
125 | return | |
126 | end | |
127 | local player = Players:GetPlayerFromCharacter(character) | |
128 | if player and (player == Player or IsTeamMate(Player, player)) then | |
129 | return | |
130 | end | |
131 | UntagHumanoid(humanoid) | |
132 | TagHumanoid(humanoid, Player) | |
133 | humanoid:TakeDamage(Damage) | |
134 | end | |
135 | ||
136 | ||
137 | function Attack() | |
138 | Damage = DamageValues.SlashDamage | |
139 | Sounds.Slash:Play() | |
140 | ||
141 | if Humanoid then | |
142 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
143 | local Anim = Instance.new("StringValue") | |
144 | Anim.Name = "toolanim" | |
145 | Anim.Value = "Slash" | |
146 | Anim.Parent = Tool | |
147 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
148 | local Anim = Tool:FindFirstChild("R15Slash") | |
149 | if Anim then | |
150 | local Track = Humanoid:LoadAnimation(Anim) | |
151 | Track:Play(0) | |
152 | end | |
153 | end | |
154 | end | |
155 | end | |
156 | ||
157 | function Lunge() | |
158 | Damage = DamageValues.LungeDamage | |
159 | ||
160 | Sounds.Lunge:Play() | |
161 | ||
162 | if Humanoid then | |
163 | if Humanoid.RigType == Enum.HumanoidRigType.R6 then | |
164 | local Anim = Instance.new("StringValue") | |
165 | Anim.Name = "toolanim" | |
166 | Anim.Value = "Lunge" | |
167 | Anim.Parent = Tool | |
168 | elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then | |
169 | local Anim = Tool:FindFirstChild("R15Lunge") | |
170 | if Anim then | |
171 | local Track = Humanoid:LoadAnimation(Anim) | |
172 | Track:Play(0) | |
173 | end | |
174 | end | |
175 | end | |
176 | if CheckIfAlive() then | |
177 | local Force = Instance.new("BodyVelocity") | |
178 | Force.velocity = Vector3.new(0, 10, 0) | |
179 | Force.maxForce = Vector3.new(0, 4000, 0) | |
180 | Debris:AddItem(Force, 0.4) | |
181 | Force.Parent = Torso | |
182 | end | |
183 | ||
184 | wait(0.2) | |
185 | Tool.Grip = Grips.Out | |
186 | wait(0.6) | |
187 | Tool.Grip = Grips.Up | |
188 | ||
189 | Damage = DamageValues.SlashDamage | |
190 | end | |
191 | ||
192 | Tool.Enabled = true | |
193 | LastAttack = 0 | |
194 | ||
195 | function Activated() | |
196 | if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then | |
197 | return | |
198 | end | |
199 | Tool.Enabled = false | |
200 | local Tick = RunService.Stepped:wait() | |
201 | if (Tick - LastAttack < 0.2) then | |
202 | Lunge() | |
203 | else | |
204 | Attack() | |
205 | end | |
206 | LastAttack = Tick | |
207 | --wait(0.5) | |
208 | Damage = DamageValues.BaseDamage | |
209 | local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ | |
210 | Name = "R15Slash", | |
211 | AnimationId = BaseUrl .. Animations.R15Slash, | |
212 | Parent = Tool | |
213 | }) | |
214 | ||
215 | local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ | |
216 | Name = "R15Lunge", | |
217 | AnimationId = BaseUrl .. Animations.R15Lunge, | |
218 | Parent = Tool | |
219 | }) | |
220 | Tool.Enabled = true | |
221 | end | |
222 | ||
223 | function CheckIfAlive() | |
224 | 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) | |
225 | end | |
226 | ||
227 | function Equipped() | |
228 | Character = Tool.Parent | |
229 | Player = Players:GetPlayerFromCharacter(Character) | |
230 | Humanoid = Character:FindFirstChildOfClass("Humanoid") | |
231 | Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") | |
232 | if not CheckIfAlive() then | |
233 | return | |
234 | end | |
235 | ToolEquipped = true | |
236 | Sounds.Unsheath:Play() | |
237 | end | |
238 | ||
239 | function Unequipped() | |
240 | Tool.Grip = Grips.Up | |
241 | ToolEquipped = false | |
242 | end | |
243 | ||
244 | Tool.Activated:Connect(Activated) | |
245 | Tool.Equipped:Connect(Equipped) | |
246 | Tool.Unequipped:Connect(Unequipped) | |
247 | ||
248 | Connection = Handle.Touched:Connect(Blow) | |
249 | local ls = [[ | |
250 | ||
251 | Mouse_Icon = "rbxasset://textures/GunCursor.png" | |
252 | Reloading_Icon = "rbxasset://textures/GunWaitCursor.png" | |
253 | ||
254 | - | Tool = game:GetService("Players").LocalPlayer.Backpack['Linked Sword'] or game:GetService("Players").LocalPlayer.Character['Linked Sword'] |
254 | + | Tool = game:GetService("Players").LocalPlayer.Backpack['Bass Sword'] or game:GetService("Players").LocalPlayer.Character['Bass Sword'] |
255 | ||
256 | Mouse = nil | |
257 | ||
258 | function UpdateIcon() | |
259 | if Mouse then | |
260 | Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon | |
261 | end | |
262 | end | |
263 | ||
264 | function OnEquipped(ToolMouse) | |
265 | Mouse = ToolMouse | |
266 | UpdateIcon() | |
267 | end | |
268 | ||
269 | function OnChanged(Property) | |
270 | if Property == "Enabled" then | |
271 | UpdateIcon() | |
272 | end | |
273 | end | |
274 | ||
275 | Tool.Equipped:Connect(OnEquipped) | |
276 | Tool.Changed:Connect(OnChanged) | |
277 | ]] | |
278 | - | NLS(ls, owner.Character) |
278 | + | NLS(ls, owner.Character) |
279 | ||
280 | Tool.Enabled = true | |
281 | ||
282 | Tool.Enabled = true | |
283 | ||
284 | Tool.Enabled = true | |
285 | ||
286 | Tool.Enabled = true | |
287 | ||
288 | Tool.Enabled = true | |
289 | ||
290 | Tool.Enabled = true | |
291 | ||
292 | Tool.Enabled = true | |
293 | ||
294 | Tool.Enabled = true |