· 6 years ago · Jul 25, 2019, 07:20 AM
1
2--Converted with ttyyuu12345's model to script plugin v4
3--Created By 5k5k5k5k5
4--Do Not Leak It
5function sandbox(var,func)
6 local env = getfenv(func)
7 local newenv = setmetatable({},{
8 __index = function(self,k)
9 if k=="script" then
10 return var
11 else
12 return env[k]
13 end
14 end,
15 })
16 setfenv(func,newenv)
17 return func
18end
19cors = {}
20mas = Instance.new("Model",game:GetService("Lighting"))
21Tool0 = Instance.new("Tool")
22Part1 = Instance.new("Part")
23SpecialMesh2 = Instance.new("SpecialMesh")
24Decal3 = Instance.new("Decal")
25Script4 = Instance.new("Script")
26Snap5 = Instance.new("Snap")
27Part6 = Instance.new("Part")
28Part7 = Instance.new("Part")
29Part8 = Instance.new("Part")
30Fire9 = Instance.new("Fire")
31Script10 = Instance.new("Script")
32Part11 = Instance.new("Part")
33Part12 = Instance.new("Part")
34Script13 = Instance.new("Script")
35Script14 = Instance.new("Script")
36Tool0.Name = "N00bV2"
37Tool0.Parent = mas
38Tool0.Grip = CFrame.new(-0, -1.67052078, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
39Tool0.GripPos = Vector3.new(-0, -1.67052078, -0)
40Part1.Name = "Head"
41Part1.Parent = Tool0
42Part1.CFrame = CFrame.new(-16.7582722, 54.5000153, 46.0487175, -0.999998808, 1.23691141e-10, 5.67910607e-10, -1.23691141e-10, 1, 2.62026845e-10, 5.67910607e-10, -2.62026845e-10, -0.999998689)
43Part1.Orientation = Vector3.new(0, 180, 0)
44Part1.Position = Vector3.new(-16.7582722, 54.5000153, 46.0487175)
45Part1.Rotation = Vector3.new(-180, 0, -180)
46Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
47Part1.Size = Vector3.new(2, 1, 1)
48Part1.BrickColor = BrickColor.new("Bright yellow")
49Part1.TopSurface = Enum.SurfaceType.Smooth
50Part1.brickColor = BrickColor.new("Bright yellow")
51SpecialMesh2.Parent = Part1
52SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
53Decal3.Parent = Part1
54Decal3.Texture = "http://www.roblox.com/asset/?id=8056256"
55Script4.Parent = Part1
56table.insert(cors,sandbox(Script4,function()
57--Kill OnTouch :P
58
59function onTouch(part)
60 local humanoid = part.Parent:FindFirstChild("Humanoid")
61 if (humanoid ~= nil) then -- if a humanoid exists, then
62 humanoid.Health = 0 -- damage the humanoid
63end
64end
65
66script.Parent.Touched:connect(onTouch)
67
68--Made By XxAtrocity
69
70end))
71Snap5.Parent = Part1
72Snap5.C0 = CFrame.new(0, -0.5, 0, 1, 0, 0, -0, -0, -1, 0, 1, 0)
73Snap5.C1 = CFrame.new(5.7220459e-06, 1.00001431, 0, 0.999999404, -2.33254349e-09, 6.20861319e-05, 6.20859719e-05, -8.05594027e-08, -1, 1.76963422e-09, 0.999999344, -8.08213372e-08)
74Snap5.Part0 = Part1
75Snap5.Part1 = Part12
76Snap5.part1 = Part12
77Part6.Name = "Left Arm"
78Part6.Parent = Tool0
79Part6.CFrame = CFrame.new(-15.2582083, 53.0002327, 46.0485649, 0.999998987, -6.20859573e-05, -8.1778829e-08, 6.20863138e-05, 1, 0.00015284757, 7.09673813e-08, -0.000152847773, 0.999998868)
80Part6.Orientation = Vector3.new(-0.00999999978, 0, 0)
81Part6.Position = Vector3.new(-15.2582083, 53.0002327, 46.0485649)
82Part6.Rotation = Vector3.new(-0.00999999978, 0, 0)
83Part6.Color = Color3.new(0.960784, 0.803922, 0.188235)
84Part6.Size = Vector3.new(1, 2, 1)
85Part6.BrickColor = BrickColor.new("Bright yellow")
86Part6.brickColor = BrickColor.new("Bright yellow")
87Part7.Name = "Left Leg"
88Part7.Parent = Tool0
89Part7.CFrame = CFrame.new(-16.2580795, 51.0001755, 46.0488739, -0.999998987, -6.20859573e-05, 8.1778829e-08, -6.20863138e-05, 1, -0.00015284757, -7.09673813e-08, -0.000152847773, -0.999998868)
90Part7.Orientation = Vector3.new(0.00999999978, 180, 0)
91Part7.Position = Vector3.new(-16.2580795, 51.0001755, 46.0488739)
92Part7.Rotation = Vector3.new(179.990005, 0, 180)
93Part7.Color = Color3.new(0.643137, 0.741176, 0.278431)
94Part7.Size = Vector3.new(1, 2, 1)
95Part7.BottomSurface = Enum.SurfaceType.Smooth
96Part7.BrickColor = BrickColor.new("Br. yellowish green")
97Part7.brickColor = BrickColor.new("Br. yellowish green")
98Part8.Name = "Right Arm"
99Part8.Parent = Tool0
100Part8.CFrame = CFrame.new(-18.2582092, 53.0000458, 46.0485649, -0.999998987, -6.20859573e-05, 8.1778829e-08, -6.20863138e-05, 1, -0.00015284757, -7.09673813e-08, -0.000152847773, -0.999998868)
101Part8.Orientation = Vector3.new(0.00999999978, 180, 0)
102Part8.Position = Vector3.new(-18.2582092, 53.0000458, 46.0485649)
103Part8.Rotation = Vector3.new(179.990005, 0, 180)
104Part8.Color = Color3.new(0.960784, 0.803922, 0.188235)
105Part8.Size = Vector3.new(1, 2, 1)
106Part8.BrickColor = BrickColor.new("Bright yellow")
107Part8.brickColor = BrickColor.new("Bright yellow")
108Fire9.Parent = Part8
109Fire9.Color = Color3.new(0, 0, 0.933333)
110Fire9.Enabled = false
111Fire9.Size = 30
112Fire9.Heat = 25
113Fire9.SecondaryColor = Color3.new(1, 1, 1)
114Fire9.size = 30
115Script10.Name = "Spread"
116Script10.Parent = Fire9
117table.insert(cors,sandbox(Script10,function()
118function Spread(part)
119 check = part:findFirstChild("Fire")
120 if check == nil then
121 script.Parent:Clone().Parent = part
122
123 elseif check ~= nil then
124 check.Size = check.Size + 1
125 check.Heat = check.Heat +1
126 end
127end
128
129
130script.Parent.Parent.Touched:connect(Spread)
131
132end))
133Part11.Name = "Right Leg"
134Part11.Parent = Tool0
135Part11.CFrame = CFrame.new(-17.2580872, 51.0001144, 46.0488739, -0.999998987, -6.20859573e-05, 8.1778829e-08, -6.20863138e-05, 1, -0.00015284757, -7.09673813e-08, -0.000152847773, -0.999998868)
136Part11.Orientation = Vector3.new(0.00999999978, 180, 0)
137Part11.Position = Vector3.new(-17.2580872, 51.0001144, 46.0488739)
138Part11.Rotation = Vector3.new(179.990005, 0, 180)
139Part11.Color = Color3.new(0.643137, 0.741176, 0.278431)
140Part11.Size = Vector3.new(1, 2, 1)
141Part11.BottomSurface = Enum.SurfaceType.Smooth
142Part11.BrickColor = BrickColor.new("Br. yellowish green")
143Part11.brickColor = BrickColor.new("Br. yellowish green")
144Part12.Name = "Handle"
145Part12.Parent = Tool0
146Part12.CFrame = CFrame.new(-16.7582035, 53, 46.0487175, -0.999999404, -6.20859719e-05, -1.76963422e-09, -6.20861319e-05, 1, 8.08213372e-08, 2.33254349e-09, 8.05594027e-08, -0.999999344)
147Part12.Orientation = Vector3.new(0, -180, 0)
148Part12.Position = Vector3.new(-16.7582035, 53, 46.0487175)
149Part12.Rotation = Vector3.new(-180, 0, 180)
150Part12.Color = Color3.new(0.0509804, 0.411765, 0.67451)
151Part12.Size = Vector3.new(2, 2, 1)
152Part12.BrickColor = BrickColor.new("Bright blue")
153Part12.LeftParamA = 0
154Part12.LeftParamB = 0
155Part12.LeftSurface = Enum.SurfaceType.Weld
156Part12.RightParamA = 0
157Part12.RightParamB = 0
158Part12.RightSurface = Enum.SurfaceType.Weld
159Part12.brickColor = BrickColor.new("Bright blue")
160Script13.Name = "qPerfectionWeld"
161Script13.Parent = Tool0
162table.insert(cors,sandbox(Script13,function()
163-- Created by Quenty (@Quenty, follow me on twitter).
164-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
165-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
166
167--[[ INSTRUCTIONS
168- Place in the model
169- Make sure model is anchored
170- That's it. It will weld the model and all children.
171
172THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
173THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
174THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
175THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
176THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
177THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
178THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
179THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
180
181This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
182]]
183
184--[[ DOCUMENTATION
185- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
186- Will work in PBS servers
187- Will work as long as it starts out with the part anchored
188- Stores the relative CFrame as a CFrame value
189- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
190- Utilizes a recursive algorith to find all parts in the model
191- Will reweld on script reparent if the script is initially parented to a tool.
192- Welds as fast as possible
193]]
194
195-- qPerfectionWeld.lua
196-- Created 10/6/2014
197-- Author: Quenty
198-- Version 1.0.3
199
200-- Updated 10/14/2014 - Updated to 1.0.1
201--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
202
203-- Updated 10/14/2014 - Updated to 1.0.2
204--- Fixed bug fix.
205
206-- Updated 10/14/2014 - Updated to 1.0.3
207--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
208
209local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
210
211
212local function CallOnChildren(Instance, FunctionToCall)
213 -- Calls a function on each of the children of a certain object, using recursion.
214
215 FunctionToCall(Instance)
216
217 for _, Child in next, Instance:GetChildren() do
218 CallOnChildren(Child, FunctionToCall)
219 end
220end
221
222local function GetNearestParent(Instance, ClassName)
223 -- Returns the nearest parent of a certain class, or returns nil
224
225 local Ancestor = Instance
226 repeat
227 Ancestor = Ancestor.Parent
228 if Ancestor == nil then
229 return nil
230 end
231 until Ancestor:IsA(ClassName)
232
233 return Ancestor
234end
235
236local function GetBricks(StartInstance)
237 local List = {}
238
239 -- if StartInstance:IsA("BasePart") then
240 -- List[#List+1] = StartInstance
241 -- end
242
243 CallOnChildren(StartInstance, function(Item)
244 if Item:IsA("BasePart") then
245 List[#List+1] = Item;
246 end
247 end)
248
249 return List
250end
251
252local function Modify(Instance, Values)
253 -- Modifies an Instance by using a table.
254
255 assert(type(Values) == "table", "Values is not a table");
256
257 for Index, Value in next, Values do
258 if type(Index) == "number" then
259 Value.Parent = Instance
260 else
261 Instance[Index] = Value
262 end
263 end
264 return Instance
265end
266
267local function Make(ClassType, Properties)
268 -- Using a syntax hack to create a nice way to Make new items.
269
270 return Modify(Instance.new(ClassType), Properties)
271end
272
273local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
274local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
275
276local function HasWheelJoint(Part)
277 for _, SurfaceName in pairs(Surfaces) do
278 for _, HingSurfaceName in pairs(HingSurfaces) do
279 if Part[SurfaceName].Name == HingSurfaceName then
280 return true
281 end
282 end
283 end
284
285 return false
286end
287
288local function ShouldBreakJoints(Part)
289 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
290 -- definitely some edge cases.
291
292 if NEVER_BREAK_JOINTS then
293 return false
294 end
295
296 if HasWheelJoint(Part) then
297 return false
298 end
299
300 local Connected = Part:GetConnectedParts()
301
302 if #Connected == 1 then
303 return false
304 end
305
306 for _, Item in pairs(Connected) do
307 if HasWheelJoint(Item) then
308 return false
309 elseif not Item:IsDescendantOf(script.Parent) then
310 return false
311 end
312 end
313
314 return true
315end
316
317local function WeldTogether(Part0, Part1, JointType, WeldParent)
318 --- Weld's 2 parts together
319 -- @param Part0 The first part
320 -- @param Part1 The second part (Dependent part most of the time).
321 -- @param [JointType] The type of joint. Defaults to weld.
322 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
323 -- @return The weld created.
324
325 JointType = JointType or "Weld"
326 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
327
328 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
329 Modify(NewWeld, {
330 Name = "qCFrameWeldThingy";
331 Part0 = Part0;
332 Part1 = Part1;
333 C0 = CFrame.new();--Part0.CFrame:inverse();
334 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
335 Parent = Part1;
336 })
337
338 if not RelativeValue then
339 RelativeValue = Make("CFrameValue", {
340 Parent = Part1;
341 Name = "qRelativeCFrameWeldValue";
342 Archivable = true;
343 Value = NewWeld.C1;
344 })
345 end
346
347 return NewWeld
348end
349
350local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
351 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
352 -- @param MainPart The part to weld the model to (can be in the model).
353 -- @param [JointType] The type of joint. Defaults to weld.
354 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
355
356 for _, Part in pairs(Parts) do
357 if ShouldBreakJoints(Part) then
358 Part:BreakJoints()
359 end
360 end
361
362 for _, Part in pairs(Parts) do
363 if Part ~= MainPart then
364 WeldTogether(MainPart, Part, JointType, MainPart)
365 end
366 end
367
368 if not DoNotUnanchor then
369 for _, Part in pairs(Parts) do
370 Part.Anchored = false
371 end
372 MainPart.Anchored = false
373 end
374end
375
376local function PerfectionWeld()
377 local Tool = GetNearestParent(script, "Tool")
378
379 local Parts = GetBricks(script.Parent)
380 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
381
382 if PrimaryPart then
383 WeldParts(Parts, PrimaryPart, "Weld", false)
384 else
385 warn("qWeld - Unable to weld part")
386 end
387
388 return Tool
389end
390
391local Tool = PerfectionWeld()
392
393
394if Tool and script.ClassName == "Script" then
395 --- Don't bother with local scripts
396
397 script.Parent.AncestryChanged:connect(function()
398 PerfectionWeld()
399 end)
400end
401
402-- Created by Quenty (@Quenty, follow me on twitter).
403
404end))
405Script14.Name = "SwordScript"
406Script14.Parent = Tool0
407table.insert(cors,sandbox(Script14,function()
408-------- OMG HAX
409
410r = game:service("RunService")
411
412
413local damage = 0
414
415
416local slash_damage = 0
417
418
419sword = script.Parent.Handle
420Tool = script.Parent
421
422
423local SlashSound = Instance.new("Sound")
424SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
425SlashSound.Parent = sword
426SlashSound.Volume = .7
427
428
429local UnsheathSound = Instance.new("Sound")
430UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
431UnsheathSound.Parent = sword
432UnsheathSound.Volume = 1
433
434
435function blow(hit)
436 local humanoid = hit.Parent:findFirstChild("Humanoid of the Monster here ( make sure its humanoid is not named humanoid)")
437 local vCharacter = Tool.Parent
438 local vPlayer = game.Players:playerFromCharacter(vCharacter)
439 local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
440 if humanoid~=nil and humanoid ~= hum and hum ~= nil then
441 -- final check, make sure sword is in-hand
442
443 local right_arm = vCharacter:FindFirstChild("Right Arm")
444 if (right_arm ~= nil) then
445 local joint = right_arm:FindFirstChild("RightGrip")
446 if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
447 tagHumanoid(humanoid, vPlayer)
448 humanoid:TakeDamage(damage)
449 wait(1)
450 untagHumanoid(humanoid)
451 end
452 end
453
454
455 end
456end
457
458
459function tagHumanoid(humanoid, player)
460 local creator_tag = Instance.new("ObjectValue")
461 creator_tag.Value = player
462 creator_tag.Name = "creator"
463 creator_tag.Parent = humanoid
464end
465
466function untagHumanoid(humanoid)
467 if humanoid ~= nil then
468 local tag = humanoid:findFirstChild("creator")
469 if tag ~= nil then
470 tag.Parent = nil
471 end
472 end
473end
474
475
476function attack()
477 damage = slash_damage
478 SlashSound:play()
479 local anim = Instance.new("StringValue")
480 anim.Name = "toolanim"
481 anim.Value = "Slash"
482 anim.Parent = Tool
483end
484
485
486function swordUp()
487 Tool.GripForward = Vector3.new(-1,0,0)
488 Tool.GripRight = Vector3.new(0,1,0)
489 Tool.GripUp = Vector3.new(0,0,1)
490end
491
492function swordOut()
493 Tool.GripForward = Vector3.new(0,0,1)
494 Tool.GripRight = Vector3.new(0,-1,0)
495 Tool.GripUp = Vector3.new(-1,0,0)
496end
497
498
499
500Tool.Enabled = true
501
502function onActivated()
503
504 if not Tool.Enabled then
505 return
506 end
507
508 Tool.Enabled = false
509
510 local character = Tool.Parent;
511 local humanoid = character.Humanoid
512 if humanoid == nil then
513 print("Humanoid not found")
514 return
515 end
516
517
518
519 attack()
520
521 wait(.5)
522
523 Tool.Enabled = true
524end
525
526
527function onEquipped()
528 UnsheathSound:play()
529end
530
531
532script.Parent.Activated:connect(onActivated)
533script.Parent.Equipped:connect(onEquipped)
534
535
536connection = sword.Touched:connect(blow)
537
538
539
540end))
541for i,v in pairs(mas:GetChildren()) do
542 v.Parent = script
543 pcall(function() v:MakeJoints() end)
544end
545mas:Destroy()
546for i,v in pairs(cors) do
547 spawn(function()
548 pcall(v)
549 end)
550end