· 4 years ago · Mar 22, 2021, 03:34 AM
1--Keybinds
2_G.UnReanimateKey = "q" --The keybind for unreanimating.
3_G.ReanimateKey = "e" --The keybind for reanimating.
4_G.R6ToggleKey = "r" --The keybind for toggling R15 to R6.
5_G.GodmodeToggleKey = "t" --The keybind for toggling godmode.
6--Options
7_G.CharacterBug = false --Set to true if your uppertorso floats when you use godmode with R15 To R6.
8_G.GodMode = true --Set to true if you want godmode.
9_G.R6 = true --Set to true if you wanna enable R15 to R6 when your R15.
10_G.AutoReanimate = true --Set to true if you want to auto reanimate and disable keybinds after executing.
11
12loadstring(game:HttpGet("https://gist.githubusercontent.com/M6HqVBcddw2qaN4s/fc29cbf0eda6f8b129778b441be3128f/raw/6StQ2n56PnEHMhQ9"))()
13getgenv().LoadLibrary = function(a)
14local t = {}
15
16------------------------------------------------------------------------------------------------------------------------
17------------------------------------------------------------------------------------------------------------------------
18------------------------------------------------------------------------------------------------------------------------
19------------------------------------------------JSON Functions Begin----------------------------------------------------
20------------------------------------------------------------------------------------------------------------------------
21------------------------------------------------------------------------------------------------------------------------
22------------------------------------------------------------------------------------------------------------------------
23
24 --JSON Encoder and Parser for Lua 5.1
25 --
26 --Copyright 2007 Shaun Brown (http://www.chipmunkav.com)
27 --All Rights Reserved.
28
29 --Permission is hereby granted, free of charge, to any person
30 --obtaining a copy of this software to deal in the Software without
31 --restriction, including without limitation the rights to use,
32 --copy, modify, merge, publish, distribute, sublicense, and/or
33 --sell copies of the Software, and to permit persons to whom the
34 --Software is furnished to do so, subject to the following conditions:
35
36 --The above copyright notice and this permission notice shall be
37 --included in all copies or substantial portions of the Software.
38 --If you find this software useful please give www.chipmunkav.com a mention.
39
40 --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41 --EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
42 --OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43 --IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
44 --ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
45 --CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
46 --CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47
48local string = string
49local math = math
50local table = table
51local error = error
52local tonumber = tonumber
53local tostring = tostring
54local type = type
55local setmetatable = setmetatable
56local pairs = pairs
57local ipairs = ipairs
58local assert = assert
59
60
61local StringBuilder = {
62 buffer = {}
63}
64
65function StringBuilder:New()
66 local o = {}
67 setmetatable(o, self)
68 self.__index = self
69 o.buffer = {}
70 return o
71end
72
73function StringBuilder:Append(s)
74 self.buffer[#self.buffer+1] = s
75end
76
77function StringBuilder:ToString()
78 return table.concat(self.buffer)
79end
80
81local JsonWriter = {
82 backslashes = {
83 ['\b'] = "\\b",
84 ['\t'] = "\\t",
85 ['\n'] = "\\n",
86 ['\f'] = "\\f",
87 ['\r'] = "\\r",
88 ['"'] = "\\\"",
89 ['\\'] = "\\\\",
90 ['/'] = "\\/"
91 }
92}
93
94function JsonWriter:New()
95 local o = {}
96 o.writer = StringBuilder:New()
97 setmetatable(o, self)
98 self.__index = self
99 return o
100end
101
102function JsonWriter:Append(s)
103 self.writer:Append(s)
104end
105
106function JsonWriter:ToString()
107 return self.writer:ToString()
108end
109
110function JsonWriter:Write(o)
111 local t = type(o)
112 if t == "nil" then
113 self:WriteNil()
114 elseif t == "boolean" then
115 self:WriteString(o)
116 elseif t == "number" then
117 self:WriteString(o)
118 elseif t == "string" then
119 self:ParseString(o)
120 elseif t == "table" then
121 self:WriteTable(o)
122 elseif t == "function" then
123 self:WriteFunction(o)
124 elseif t == "thread" then
125 self:WriteError(o)
126 elseif t == "userdata" then
127 self:WriteError(o)
128 end
129end
130
131function JsonWriter:WriteNil()
132 self:Append("null")
133end
134
135function JsonWriter:WriteString(o)
136 self:Append(tostring(o))
137end
138
139function JsonWriter:ParseString(s)
140 self:Append('"')
141 self:Append(string.gsub(s, "[%z%c\\\"/]", function(n)
142 local c = self.backslashes[n]
143 if c then return c end
144 return string.format("\\u%.4X", string.byte(n))
145 end))
146 self:Append('"')
147end
148
149function JsonWriter:IsArray(t)
150 local count = 0
151 local isindex = function(k)
152 if type(k) == "number" and k > 0 then
153 if math.floor(k) == k then
154 return true
155 end
156 end
157 return false
158 end
159 for k,v in pairs(t) do
160 if not isindex(k) then
161 return false, '{', '}'
162 else
163 count = math.max(count, k)
164 end
165 end
166 return true, '[', ']', count
167end
168
169function JsonWriter:WriteTable(t)
170 local ba, st, et, n = self:IsArray(t)
171 self:Append(st)
172 if ba then
173 for i = 1, n do
174 self:Write(t[i])
175 if i < n then
176 self:Append(',')
177 end
178 end
179 else
180 local first = true;
181 for k, v in pairs(t) do
182 if not first then
183 self:Append(',')
184 end
185 first = false;
186 self:ParseString(k)
187 self:Append(':')
188 self:Write(v)
189 end
190 end
191 self:Append(et)
192end
193
194function JsonWriter:WriteError(o)
195 error(string.format(
196 "Encoding of %s unsupported",
197 tostring(o)))
198end
199
200function JsonWriter:WriteFunction(o)
201 if o == Null then
202 self:WriteNil()
203 else
204 self:WriteError(o)
205 end
206end
207
208local StringReader = {
209 s = "",
210 i = 0
211}
212
213function StringReader:New(s)
214 local o = {}
215 setmetatable(o, self)
216 self.__index = self
217 o.s = s or o.s
218 return o
219end
220
221function StringReader:Peek()
222 local i = self.i + 1
223 if i <= #self.s then
224 return string.sub(self.s, i, i)
225 end
226 return nil
227end
228
229function StringReader:Next()
230 self.i = self.i+1
231 if self.i <= #self.s then
232 return string.sub(self.s, self.i, self.i)
233 end
234 return nil
235end
236
237function StringReader:All()
238 return self.s
239end
240
241local JsonReader = {
242 escapes = {
243 ['t'] = '\t',
244 ['n'] = '\n',
245 ['f'] = '\f',
246 ['r'] = '\r',
247 ['b'] = '\b',
248 }
249}
250
251function JsonReader:New(s)
252 local o = {}
253 o.reader = StringReader:New(s)
254 setmetatable(o, self)
255 self.__index = self
256 return o;
257end
258
259function JsonReader:Read()
260 self:SkipWhiteSpace()
261 local peek = self:Peek()
262 if peek == nil then
263 error(string.format(
264 "Nil string: '%s'",
265 self:All()))
266 elseif peek == '{' then
267 return self:ReadObject()
268 elseif peek == '[' then
269 return self:ReadArray()
270 elseif peek == '"' then
271 return self:ReadString()
272 elseif string.find(peek, "[%+%-%d]") then
273 return self:ReadNumber()
274 elseif peek == 't' then
275 return self:ReadTrue()
276 elseif peek == 'f' then
277 return self:ReadFalse()
278 elseif peek == 'n' then
279 return self:ReadNull()
280 elseif peek == '/' then
281 self:ReadComment()
282 return self:Read()
283 else
284 return nil
285 end
286end
287
288function JsonReader:ReadTrue()
289 self:TestReservedWord{'t','r','u','e'}
290 return true
291end
292
293function JsonReader:ReadFalse()
294 self:TestReservedWord{'f','a','l','s','e'}
295 return false
296end
297
298function JsonReader:ReadNull()
299 self:TestReservedWord{'n','u','l','l'}
300 return nil
301end
302
303function JsonReader:TestReservedWord(t)
304 for i, v in ipairs(t) do
305 if self:Next() ~= v then
306 error(string.format(
307 "Error reading '%s': %s",
308 table.concat(t),
309 self:All()))
310 end
311 end
312end
313
314function JsonReader:ReadNumber()
315 local result = self:Next()
316 local peek = self:Peek()
317 while peek ~= nil and string.find(
318 peek,
319 "[%+%-%d%.eE]") do
320 result = result .. self:Next()
321 peek = self:Peek()
322 end
323 result = tonumber(result)
324 if result == nil then
325 error(string.format(
326 "Invalid number: '%s'",
327 result))
328 else
329 return result
330 end
331end
332
333function JsonReader:ReadString()
334 local result = ""
335 assert(self:Next() == '"')
336 while self:Peek() ~= '"' do
337 local ch = self:Next()
338 if ch == '\\' then
339 ch = self:Next()
340 if self.escapes[ch] then
341 ch = self.escapes[ch]
342 end
343 end
344 result = result .. ch
345 end
346 assert(self:Next() == '"')
347 local fromunicode = function(m)
348 return string.char(tonumber(m, 16))
349 end
350 return string.gsub(
351 result,
352 "u%x%x(%x%x)",
353 fromunicode)
354end
355
356function JsonReader:ReadComment()
357 assert(self:Next() == '/')
358 local second = self:Next()
359 if second == '/' then
360 self:ReadSingleLineComment()
361 elseif second == '*' then
362 self:ReadBlockComment()
363 else
364 error(string.format(
365 "Invalid comment: %s",
366 self:All()))
367 end
368end
369
370function JsonReader:ReadBlockComment()
371 local done = false
372 while not done do
373 local ch = self:Next()
374 if ch == '*' and self:Peek() == '/' then
375 done = true
376 end
377 if not done and
378 ch == '/' and
379 self:Peek() == "*" then
380 error(string.format(
381 "Invalid comment: %s, '/*' illegal.",
382 self:All()))
383 end
384 end
385 self:Next()
386end
387
388function JsonReader:ReadSingleLineComment()
389 local ch = self:Next()
390 while ch ~= '\r' and ch ~= '\n' do
391 ch = self:Next()
392 end
393end
394
395function JsonReader:ReadArray()
396 local result = {}
397 assert(self:Next() == '[')
398 local done = false
399 if self:Peek() == ']' then
400 done = true;
401 end
402 while not done do
403 local item = self:Read()
404 result[#result+1] = item
405 self:SkipWhiteSpace()
406 if self:Peek() == ']' then
407 done = true
408 end
409 if not done then
410 local ch = self:Next()
411 if ch ~= ',' then
412 error(string.format(
413 "Invalid array: '%s' due to: '%s'",
414 self:All(), ch))
415 end
416 end
417 end
418 assert(']' == self:Next())
419 return result
420end
421
422function JsonReader:ReadObject()
423 local result = {}
424 assert(self:Next() == '{')
425 local done = false
426 if self:Peek() == '}' then
427 done = true
428 end
429 while not done do
430 local key = self:Read()
431 if type(key) ~= "string" then
432 error(string.format(
433 "Invalid non-string object key: %s",
434 key))
435 end
436 self:SkipWhiteSpace()
437 local ch = self:Next()
438 if ch ~= ':' then
439 error(string.format(
440 "Invalid object: '%s' due to: '%s'",
441 self:All(),
442 ch))
443 end
444 self:SkipWhiteSpace()
445 local val = self:Read()
446 result[key] = val
447 self:SkipWhiteSpace()
448 if self:Peek() == '}' then
449 done = true
450 end
451 if not done then
452 ch = self:Next()
453 if ch ~= ',' then
454 error(string.format(
455 "Invalid array: '%s' near: '%s'",
456 self:All(),
457 ch))
458 end
459 end
460 end
461 assert(self:Next() == "}")
462 return result
463end
464
465function JsonReader:SkipWhiteSpace()
466 local p = self:Peek()
467 while p ~= nil and string.find(p, "[%s/]") do
468 if p == '/' then
469 self:ReadComment()
470 else
471 self:Next()
472 end
473 p = self:Peek()
474 end
475end
476
477function JsonReader:Peek()
478 return self.reader:Peek()
479end
480
481function JsonReader:Next()
482 return self.reader:Next()
483end
484
485function JsonReader:All()
486 return self.reader:All()
487end
488
489function Encode(o)
490 local writer = JsonWriter:New()
491 writer:Write(o)
492 return writer:ToString()
493end
494
495function Decode(s)
496 local reader = JsonReader:New(s)
497 return reader:Read()
498end
499
500function Null()
501 return Null
502end
503-------------------- End JSON Parser ------------------------
504
505t.DecodeJSON = function(jsonString)
506 pcall(function() warn("RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead.") end)
507
508 if type(jsonString) == "string" then
509 return Decode(jsonString)
510 end
511 print("RbxUtil.DecodeJSON expects string argument!")
512 return nil
513end
514
515t.EncodeJSON = function(jsonTable)
516 pcall(function() warn("RbxUtility.EncodeJSON is deprecated, please use Game:GetService('HttpService'):JSONEncode() instead.") end)
517 return Encode(jsonTable)
518end
519
520
521
522
523
524
525
526
527------------------------------------------------------------------------------------------------------------------------
528------------------------------------------------------------------------------------------------------------------------
529------------------------------------------------------------------------------------------------------------------------
530--------------------------------------------Terrain Utilities Begin-----------------------------------------------------
531------------------------------------------------------------------------------------------------------------------------
532------------------------------------------------------------------------------------------------------------------------
533------------------------------------------------------------------------------------------------------------------------
534--makes a wedge at location x, y, z
535--sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w
536--returns true if made a wedge, false if the cell remains a block
537t.MakeWedge = function(x, y, z, defaultmaterial)
538 return game:GetService("Terrain"):AutoWedgeCell(x,y,z)
539end
540
541t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent)
542 local terrain = game:GetService("Workspace"):FindFirstChild("Terrain")
543 if not terrain then return end
544
545 assert(regionToSelect)
546 assert(color)
547
548 if not type(regionToSelect) == "Region3" then
549 error("regionToSelect (first arg), should be of type Region3, but is type",type(regionToSelect))
550 end
551 if not type(color) == "BrickColor" then
552 error("color (second arg), should be of type BrickColor, but is type",type(color))
553 end
554
555 -- frequently used terrain calls (speeds up call, no lookup necessary)
556 local GetCell = terrain.GetCell
557 local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid
558 local CellCenterToWorld = terrain.CellCenterToWorld
559 local emptyMaterial = Enum.CellMaterial.Empty
560
561 -- container for all adornments, passed back to user
562 local selectionContainer = Instance.new("Model")
563 selectionContainer.Name = "SelectionContainer"
564 selectionContainer.Archivable = false
565 if selectionParent then
566 selectionContainer.Parent = selectionParent
567 else
568 selectionContainer.Parent = game:GetService("Workspace")
569 end
570
571 local updateSelection = nil -- function we return to allow user to update selection
572 local currentKeepAliveTag = nil -- a tag that determines whether adorns should be destroyed
573 local aliveCounter = 0 -- helper for currentKeepAliveTag
574 local lastRegion = nil -- used to stop updates that do nothing
575 local adornments = {} -- contains all adornments
576 local reusableAdorns = {}
577
578 local selectionPart = Instance.new("Part")
579 selectionPart.Name = "SelectionPart"
580 selectionPart.Transparency = 1
581 selectionPart.Anchored = true
582 selectionPart.Locked = true
583 selectionPart.CanCollide = false
584 selectionPart.Size = Vector3.new(4.2,4.2,4.2)
585
586 local selectionBox = Instance.new("SelectionBox")
587
588 -- srs translation from region3 to region3int16
589 local function Region3ToRegion3int16(region3)
590 local theLowVec = region3.CFrame.p - (region3.Size/2) + Vector3.new(2,2,2)
591 local lowCell = WorldToCellPreferSolid(terrain,theLowVec)
592
593 local theHighVec = region3.CFrame.p + (region3.Size/2) - Vector3.new(2,2,2)
594 local highCell = WorldToCellPreferSolid(terrain, theHighVec)
595
596 local highIntVec = Vector3int16.new(highCell.x,highCell.y,highCell.z)
597 local lowIntVec = Vector3int16.new(lowCell.x,lowCell.y,lowCell.z)
598
599 return Region3int16.new(lowIntVec,highIntVec)
600 end
601
602 -- helper function that creates the basis for a selection box
603 function createAdornment(theColor)
604 local selectionPartClone = nil
605 local selectionBoxClone = nil
606
607 if #reusableAdorns > 0 then
608 selectionPartClone = reusableAdorns[1]["part"]
609 selectionBoxClone = reusableAdorns[1]["box"]
610 table.remove(reusableAdorns,1)
611
612 selectionBoxClone.Visible = true
613 else
614 selectionPartClone = selectionPart:Clone()
615 selectionPartClone.Archivable = false
616
617 selectionBoxClone = selectionBox:Clone()
618 selectionBoxClone.Archivable = false
619
620 selectionBoxClone.Adornee = selectionPartClone
621 selectionBoxClone.Parent = selectionContainer
622
623 selectionBoxClone.Adornee = selectionPartClone
624
625 selectionBoxClone.Parent = selectionContainer
626 end
627
628 if theColor then
629 selectionBoxClone.Color = theColor
630 end
631
632 return selectionPartClone, selectionBoxClone
633 end
634
635 -- iterates through all current adornments and deletes any that don't have latest tag
636 function cleanUpAdornments()
637 for cellPos, adornTable in pairs(adornments) do
638
639 if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this
640 adornTable.SelectionBox.Visible = false
641 table.insert(reusableAdorns,{part = adornTable.SelectionPart, box = adornTable.SelectionBox})
642 adornments[cellPos] = nil
643 end
644 end
645 end
646
647 -- helper function to update tag
648 function incrementAliveCounter()
649 aliveCounter = aliveCounter + 1
650 if aliveCounter > 1000000 then
651 aliveCounter = 0
652 end
653 return aliveCounter
654 end
655
656 -- finds full cells in region and adorns each cell with a box, with the argument color
657 function adornFullCellsInRegion(region, color)
658 local regionBegin = region.CFrame.p - (region.Size/2) + Vector3.new(2,2,2)
659 local regionEnd = region.CFrame.p + (region.Size/2) - Vector3.new(2,2,2)
660
661 local cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin)
662 local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
663
664 currentKeepAliveTag = incrementAliveCounter()
665 for y = cellPosBegin.y, cellPosEnd.y do
666 for z = cellPosBegin.z, cellPosEnd.z do
667 for x = cellPosBegin.x, cellPosEnd.x do
668 local cellMaterial = GetCell(terrain, x, y, z)
669
670 if cellMaterial ~= emptyMaterial then
671 local cframePos = CellCenterToWorld(terrain, x, y, z)
672 local cellPos = Vector3int16.new(x,y,z)
673
674 local updated = false
675 for cellPosAdorn, adornTable in pairs(adornments) do
676 if cellPosAdorn == cellPos then
677 adornTable.KeepAlive = currentKeepAliveTag
678 if color then
679 adornTable.SelectionBox.Color = color
680 end
681 updated = true
682 break
683 end
684 end
685
686 if not updated then
687 local selectionPart, selectionBox = createAdornment(color)
688 selectionPart.Size = Vector3.new(4,4,4)
689 selectionPart.CFrame = CFrame.new(cframePos)
690 local adornTable = {SelectionPart = selectionPart, SelectionBox = selectionBox, KeepAlive = currentKeepAliveTag}
691 adornments[cellPos] = adornTable
692 end
693 end
694 end
695 end
696 end
697 cleanUpAdornments()
698 end
699
700
701 ------------------------------------- setup code ------------------------------
702 lastRegion = regionToSelect
703
704 if selectEmptyCells then -- use one big selection to represent the area selected
705 local selectionPart, selectionBox = createAdornment(color)
706
707 selectionPart.Size = regionToSelect.Size
708 selectionPart.CFrame = regionToSelect.CFrame
709
710 adornments.SelectionPart = selectionPart
711 adornments.SelectionBox = selectionBox
712
713 updateSelection =
714 function (newRegion, color)
715 if newRegion and newRegion ~= lastRegion then
716 lastRegion = newRegion
717 selectionPart.Size = newRegion.Size
718 selectionPart.CFrame = newRegion.CFrame
719 end
720 if color then
721 selectionBox.Color = color
722 end
723 end
724 else -- use individual cell adorns to represent the area selected
725 adornFullCellsInRegion(regionToSelect, color)
726 updateSelection =
727 function (newRegion, color)
728 if newRegion and newRegion ~= lastRegion then
729 lastRegion = newRegion
730 adornFullCellsInRegion(newRegion, color)
731 end
732 end
733
734 end
735
736 local destroyFunc = function()
737 updateSelection = nil
738 if selectionContainer then selectionContainer:Destroy() end
739 adornments = nil
740 end
741
742 return updateSelection, destroyFunc
743end
744
745-----------------------------Terrain Utilities End-----------------------------
746
747
748
749
750
751
752
753------------------------------------------------------------------------------------------------------------------------
754------------------------------------------------------------------------------------------------------------------------
755------------------------------------------------------------------------------------------------------------------------
756------------------------------------------------Signal class begin------------------------------------------------------
757------------------------------------------------------------------------------------------------------------------------
758------------------------------------------------------------------------------------------------------------------------
759------------------------------------------------------------------------------------------------------------------------
760--[[
761A 'Signal' object identical to the internal RBXScriptSignal object in it's public API and semantics. This function
762can be used to create "custom events" for user-made code.
763API:
764Method :connect( function handler )
765 Arguments: The function to connect to.
766 Returns: A new connection object which can be used to disconnect the connection
767 Description: Connects this signal to the function specified by |handler|. That is, when |fire( ... )| is called for
768 the signal the |handler| will be called with the arguments given to |fire( ... )|. Note, the functions
769 connected to a signal are called in NO PARTICULAR ORDER, so connecting one function after another does
770 NOT mean that the first will be called before the second as a result of a call to |fire|.
771
772Method :disconnect()
773 Arguments: None
774 Returns: None
775 Description: Disconnects all of the functions connected to this signal.
776
777Method :fire( ... )
778 Arguments: Any arguments are accepted
779 Returns: None
780 Description: Calls all of the currently connected functions with the given arguments.
781
782Method :wait()
783 Arguments: None
784 Returns: The arguments given to fire
785 Description: This call blocks until
786]]
787
788function t.CreateSignal()
789 local this = {}
790
791 local mBindableEvent = Instance.new('BindableEvent')
792 local mAllCns = {} --all connection objects returned by mBindableEvent::connect
793
794 --main functions
795 function this:connect(func)
796 if self ~= this then error("connect must be called with `:`, not `.`", 2) end
797 if type(func) ~= 'function' then
798 error("Argument #1 of connect must be a function, got a "..type(func), 2)
799 end
800 local cn = mBindableEvent.Event:Connect(func)
801 mAllCns[cn] = true
802 local pubCn = {}
803 function pubCn:disconnect()
804 cn:Disconnect()
805 mAllCns[cn] = nil
806 end
807 pubCn.Disconnect = pubCn.disconnect
808
809 return pubCn
810 end
811
812 function this:disconnect()
813 if self ~= this then error("disconnect must be called with `:`, not `.`", 2) end
814 for cn, _ in pairs(mAllCns) do
815 cn:Disconnect()
816 mAllCns[cn] = nil
817 end
818 end
819
820 function this:wait()
821 if self ~= this then error("wait must be called with `:`, not `.`", 2) end
822 return mBindableEvent.Event:Wait()
823 end
824
825 function this:fire(...)
826 if self ~= this then error("fire must be called with `:`, not `.`", 2) end
827 mBindableEvent:Fire(...)
828 end
829
830 this.Connect = this.connect
831 this.Disconnect = this.disconnect
832 this.Wait = this.wait
833 this.Fire = this.fire
834
835 return this
836end
837
838------------------------------------------------- Sigal class End ------------------------------------------------------
839
840
841
842
843------------------------------------------------------------------------------------------------------------------------
844------------------------------------------------------------------------------------------------------------------------
845------------------------------------------------------------------------------------------------------------------------
846-----------------------------------------------Create Function Begins---------------------------------------------------
847------------------------------------------------------------------------------------------------------------------------
848------------------------------------------------------------------------------------------------------------------------
849------------------------------------------------------------------------------------------------------------------------
850--[[
851A "Create" function for easy creation of Roblox instances. The function accepts a string which is the classname of
852the object to be created. The function then returns another function which either accepts accepts no arguments, in
853which case it simply creates an object of the given type, or a table argument that may contain several types of data,
854in which case it mutates the object in varying ways depending on the nature of the aggregate data. These are the
855type of data and what operation each will perform:
8561) A string key mapping to some value:
857 Key-Value pairs in this form will be treated as properties of the object, and will be assigned in NO PARTICULAR
858 ORDER. If the order in which properties is assigned matter, then they must be assigned somewhere else than the
859 |Create| call's body.
860
8612) An integral key mapping to another Instance:
862 Normal numeric keys mapping to Instances will be treated as children if the object being created, and will be
863 parented to it. This allows nice recursive calls to Create to create a whole hierarchy of objects without a
864 need for temporary variables to store references to those objects.
865
8663) A key which is a value returned from Create.Event( eventname ), and a value which is a function function
867 The Create.E( string ) function provides a limited way to connect to signals inside of a Create hierarchy
868 for those who really want such a functionality. The name of the event whose name is passed to
869 Create.E( string )
870
8714) A key which is the Create function itself, and a value which is a function
872 The function will be run with the argument of the object itself after all other initialization of the object is
873 done by create. This provides a way to do arbitrary things involving the object from withing the create
874 hierarchy.
875 Note: This function is called SYNCHRONOUSLY, that means that you should only so initialization in
876 it, not stuff which requires waiting, as the Create call will block until it returns. While waiting in the
877 constructor callback function is possible, it is probably not a good design choice.
878 Note: Since the constructor function is called after all other initialization, a Create block cannot have two
879 constructor functions, as it would not be possible to call both of them last, also, this would be unnecessary.
880
881
882Some example usages:
883
884A simple example which uses the Create function to create a model object and assign two of it's properties.
885local model = Create'Model'{
886 Name = 'A New model',
887 Parent = game.Workspace,
888}
889
890
891An example where a larger hierarchy of object is made. After the call the hierarchy will look like this:
892Model_Container
893 |-ObjectValue
894 | |
895 | `-BoolValueChild
896 `-IntValue
897
898local model = Create'Model'{
899 Name = 'Model_Container',
900 Create'ObjectValue'{
901 Create'BoolValue'{
902 Name = 'BoolValueChild',
903 },
904 },
905 Create'IntValue'{},
906}
907
908
909An example using the event syntax:
910
911local part = Create'Part'{
912 [Create.E'Touched'] = function(part)
913 print("I was touched by "..part.Name)
914 end,
915}
916
917
918An example using the general constructor syntax:
919
920local model = Create'Part'{
921 [Create] = function(this)
922 print("Constructor running!")
923 this.Name = GetGlobalFoosAndBars(this)
924 end,
925}
926
927
928Note: It is also perfectly legal to save a reference to the function returned by a call Create, this will not cause
929 any unexpected behavior. EG:
930 local partCreatingFunction = Create'Part'
931 local part = partCreatingFunction()
932]]
933
934--the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it
935--will be created in several steps rather than as a single function declaration.
936local function Create_PrivImpl(objectType)
937 if type(objectType) ~= 'string' then
938 error("Argument of Create must be a string", 2)
939 end
940 --return the proxy function that gives us the nice Create'string'{data} syntax
941 --The first function call is a function call using Lua's single-string-argument syntax
942 --The second function call is using Lua's single-table-argument syntax
943 --Both can be chained together for the nice effect.
944 return function(dat)
945 --default to nothing, to handle the no argument given case
946 dat = dat or {}
947
948 --make the object to mutate
949 local obj = Instance.new(objectType)
950 local parent = nil
951
952 --stored constructor function to be called after other initialization
953 local ctor = nil
954
955 for k, v in pairs(dat) do
956 --add property
957 if type(k) == 'string' then
958 if k == 'Parent' then
959 -- Parent should always be set last, setting the Parent of a new object
960 -- immediately makes performance worse for all subsequent property updates.
961 parent = v
962 else
963 obj[k] = v
964 end
965
966
967 --add child
968 elseif type(k) == 'number' then
969 if type(v) ~= 'userdata' then
970 error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2)
971 end
972 v.Parent = obj
973
974
975 --event connect
976 elseif type(k) == 'table' and k.__eventname then
977 if type(v) ~= 'function' then
978 error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\
979 got: "..tostring(v), 2)
980 end
981 obj[k.__eventname]:connect(v)
982
983
984 --define constructor function
985 elseif k == t.Create then
986 if type(v) ~= 'function' then
987 error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \
988 got: "..tostring(v), 2)
989 elseif ctor then
990 --ctor already exists, only one allowed
991 error("Bad entry in Create body: Only one constructor function is allowed", 2)
992 end
993 ctor = v
994
995
996 else
997 error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2)
998 end
999 end
1000
1001 --apply constructor function if it exists
1002 if ctor then
1003 ctor(obj)
1004 end
1005
1006 if parent then
1007 obj.Parent = parent
1008 end
1009
1010 --return the completed object
1011 return obj
1012 end
1013end
1014
1015--now, create the functor:
1016t.Create = setmetatable({}, {__call = function(tb, ...) return Create_PrivImpl(...) end})
1017
1018--and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create
1019--function can recognize as special.
1020t.Create.E = function(eventName)
1021 return {__eventname = eventName}
1022end
1023
1024-------------------------------------------------Create function End----------------------------------------------------
1025
1026
1027
1028
1029------------------------------------------------------------------------------------------------------------------------
1030------------------------------------------------------------------------------------------------------------------------
1031------------------------------------------------------------------------------------------------------------------------
1032------------------------------------------------Documentation Begin-----------------------------------------------------
1033------------------------------------------------------------------------------------------------------------------------
1034------------------------------------------------------------------------------------------------------------------------
1035------------------------------------------------------------------------------------------------------------------------
1036
1037t.Help =
1038 function(funcNameOrFunc)
1039 --input argument can be a string or a function. Should return a description (of arguments and expected side effects)
1040 if funcNameOrFunc == "DecodeJSON" or funcNameOrFunc == t.DecodeJSON then
1041 return "Function DecodeJSON. " ..
1042 "Arguments: (string). " ..
1043 "Side effect: returns a table with all parsed JSON values"
1044 end
1045 if funcNameOrFunc == "EncodeJSON" or funcNameOrFunc == t.EncodeJSON then
1046 return "Function EncodeJSON. " ..
1047 "Arguments: (table). " ..
1048 "Side effect: returns a string composed of argument table in JSON data format"
1049 end
1050 if funcNameOrFunc == "MakeWedge" or funcNameOrFunc == t.MakeWedge then
1051 return "Function MakeWedge. " ..
1052 "Arguments: (x, y, z, [default material]). " ..
1053 "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if "..
1054 "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. "..
1055 "Returns true if made a wedge, false if the cell remains a block "
1056 end
1057 if funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == t.SelectTerrainRegion then
1058 return "Function SelectTerrainRegion. " ..
1059 "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " ..
1060 "Description: Selects all terrain via a series of selection boxes within the regionToSelect " ..
1061 "(this should be a region3 value). The selection box color is detemined by the color argument " ..
1062 "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." ..
1063 "SelectEmptyCells is bool, when true will select all cells in the " ..
1064 "region, otherwise we only select non-empty cells. Returns a function that can update the selection," ..
1065 "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " ..
1066 "Also returns a second function that takes no arguments and destroys the selection"
1067 end
1068 if funcNameOrFunc == "CreateSignal" or funcNameOrFunc == t.CreateSignal then
1069 return "Function CreateSignal. "..
1070 "Arguments: None. "..
1071 "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class "..
1072 "used for events in Objects, but is a Lua-side object so it can be used to create custom events in"..
1073 "Lua code. "..
1074 "Methods of the Signal object: :connect, :wait, :fire, :disconnect. "..
1075 "For more info you can pass the method name to the Help function, or view the wiki page "..
1076 "for this library. EG: Help('Signal:connect')."
1077 end
1078 if funcNameOrFunc == "Signal:connect" then
1079 return "Method Signal:connect. "..
1080 "Arguments: (function handler). "..
1081 "Return: A connection object which can be used to disconnect the connection to this handler. "..
1082 "Description: Connectes a handler function to this Signal, so that when |fire| is called the "..
1083 "handler function will be called with the arguments passed to |fire|."
1084 end
1085 if funcNameOrFunc == "Signal:wait" then
1086 return "Method Signal:wait. "..
1087 "Arguments: None. "..
1088 "Returns: The arguments passed to the next call to |fire|. "..
1089 "Description: This call does not return until the next call to |fire| is made, at which point it "..
1090 "will return the values which were passed as arguments to that |fire| call."
1091 end
1092 if funcNameOrFunc == "Signal:fire" then
1093 return "Method Signal:fire. "..
1094 "Arguments: Any number of arguments of any type. "..
1095 "Returns: None. "..
1096 "Description: This call will invoke any connected handler functions, and notify any waiting code "..
1097 "attached to this Signal to continue, with the arguments passed to this function. Note: The calls "..
1098 "to handlers are made asynchronously, so this call will return immediately regardless of how long "..
1099 "it takes the connected handler functions to complete."
1100 end
1101 if funcNameOrFunc == "Signal:disconnect" then
1102 return "Method Signal:disconnect. "..
1103 "Arguments: None. "..
1104 "Returns: None. "..
1105 "Description: This call disconnects all handlers attacched to this function, note however, it "..
1106 "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method "..
1107 "can also be called on the connection object which is returned from Signal:connect to only "..
1108 "disconnect a single handler, as opposed to this method, which will disconnect all handlers."
1109 end
1110 if funcNameOrFunc == "Create" then
1111 return "Function Create. "..
1112 "Arguments: A table containing information about how to construct a collection of objects. "..
1113 "Returns: The constructed objects. "..
1114 "Descrition: Create is a very powerfull function, whose description is too long to fit here, and "..
1115 "is best described via example, please see the wiki page for a description of how to use it."
1116 end
1117 end
1118
1119--------------------------------------------Documentation Ends----------------------------------------------------------
1120
1121return t
1122end
1123
1124local pistol = game:GetService("Players").LocalPlayer.Character["Black Type-37 Pulse Rifle"]
1125pistol.Handle.CustomAtt0:Destroy()
1126pistol.Handle.CustomAtt1:Destroy()
1127
1128local bat = game:GetService("Players").LocalPlayer.Character["Jackette's SluggerAccessory"]
1129bat.Handle.CustomAtt0:Destroy()
1130bat.Handle.CustomAtt1:Destroy()
1131
1132local function weld(part0, part1)
1133 local attachment0 = Instance.new("Attachment", part0)
1134 if part0 == pistol.Handle then
1135 attachment0.Rotation = Vector3.new(-90, -60, -270)
1136 elseif part0 == bat.Handle then
1137 attachment0.Position = Vector3.new(0, 0.5, 0)
1138 attachment0.Rotation = Vector3.new(0, -90, 0)
1139 end
1140 local attachment1 = Instance.new("Attachment", part1)
1141 local weldpos = Instance.new("AlignPosition", part0)
1142 weldpos.Attachment0 = attachment0
1143 weldpos.Attachment1 = attachment1
1144 weldpos.RigidityEnabled = false
1145 weldpos.ReactionForceEnabled = false
1146 weldpos.ApplyAtCenterOfMass = false
1147 weldpos.MaxForce = 10000
1148 weldpos.MaxVelocity = 10000
1149 weldpos.Responsiveness = 10000
1150 local weldrot = Instance.new("AlignOrientation", part0)
1151 weldrot.Attachment0 = attachment0
1152 weldrot.Attachment1 = attachment1
1153 weldrot.ReactionTorqueEnabled = true
1154 weldrot.PrimaryAxisOnly = false
1155 weldrot.MaxTorque = 10000
1156 weldrot.MaxAngularVelocity = 10000
1157 weldrot.Responsiveness = 10000
1158end
1159
1160----------------------------------------------------------------
1161--WATCH OUT HERE COMES THE COPPAS--
1162----------------------------------------------------------------
1163--By CKbackup (Sugarie Saffron) --
1164--YT: https://www.youtube.com/channel/UC8n9FFz7e6Zo13ob_5F9MJw--
1165--Discord: Sugarie Saffron#4705 --
1166----------------------------------------------------------------
1167
1168print([[
1169--Script Cop--
1170By CKbackup (Sugarie Saffron)
1171YT: https://www.youtube.com/channel/UC8n9FFz7e6Zo13ob_5F9MJw
1172Discord: Sugarie Saffron#4705
1173--------------------------------
1174As I've been demoted from my SB
1175Mod rank in VSB, I don't see the
1176need to hold this back any longer.
1177
1178Also, if the anims look weird or
1179the weapon looks out of place,
1180it's because it's actually modeled
1181off a scaled rig with a package.
1182It looks better with the Boy
1183package.
1184--------------------------------
1185(Keys)
1186M - Mute/Play Music
1187
1188(Hold) Q - Run
1189
1190Click - Baton Swing
1191Z - Pistol Shoot (You can also hold)
1192
1193|Fixed By 12 Coolkeion, Subscribe To Me|
1194]])
1195
1196wait(1/60)
1197Effects = { }
1198local attackm = nil
1199local Player = game:service'Players'.localPlayer
1200local chara = game:GetService("Players").LocalPlayer.Character["NullwareReanim"]
1201local Humanoid = chara:FindFirstChildOfClass("Humanoid")
1202local Mouse = Player:GetMouse()
1203local LeftArm = chara["Left Arm"]
1204local RightArm = chara["Right Arm"]
1205local LeftLeg = chara["Left Leg"]
1206local RightLeg = chara["Right Leg"]
1207local Head = chara.Head
1208local Torso = chara.Torso
1209local RootPart = chara.HumanoidRootPart
1210local RootJoint = RootPart.RootJoint
1211local attack = false
1212local Anim = 'Idle'
1213local attacktype = 1
1214local delays = false
1215local play = true
1216local targetted = nil
1217local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
1218local velocity = RootPart.Velocity.y
1219local sine = 0
1220local change = 1
1221local doe = 0
1222local Create = LoadLibrary("RbxUtility").Create
1223
1224local plrs = game:GetService("Players")
1225local plr = plrs.LocalPlayer
1226local char = plr.Character
1227local hrp = char.HumanoidRootPart
1228
1229hrp.Name = "HumanoidRootPart"
1230hrp.Transparency = 0.5
1231hrp.Anchored = false
1232if hrp:FindFirstChildOfClass("AlignPosition") then
1233 hrp:FindFirstChildOfClass("AlignPosition"):Destroy()
1234end
1235if hrp:FindFirstChildOfClass("AlignOrientation") then
1236 hrp:FindFirstChildOfClass("AlignOrientation"):Destroy()
1237end
1238local bp = Instance.new("BodyPosition", hrp)
1239bp.Position = hrp.Position
1240bp.D = 9999999
1241bp.P = 999999999999999
1242bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
1243local flinger = Instance.new("BodyAngularVelocity",hrp)
1244flinger.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
1245flinger.P = 1000000000000000000000000000
1246flinger.AngularVelocity = Vector3.new(10000,10000,10000)
1247
1248spawn(function()
1249 while game:GetService("RunService").Heartbeat:Wait() do
1250 if attack == false then
1251 bp.Position = game:GetService("Players").LocalPlayer.Character["NullwareReanim"].HumanoidRootPart.Position
1252 end
1253 end
1254end)
1255
1256plr:GetMouse().Button1Down:Connect(function()
1257 repeat wait() until attack == true
1258 repeat
1259 game:GetService("RunService").Heartbeat:Wait()
1260 if attackm == "baton" then
1261 bp.Position = bat.Handle.Position
1262 end
1263 until attack == false
1264end)
1265
1266plr:GetMouse().KeyDown:Connect(function(key)
1267 if key == "z" then
1268 repeat wait() until attack == true
1269 repeat
1270 game:GetService("RunService").Heartbeat:Wait()
1271 if attackm == "gun" then
1272 if plr:GetMouse().Target ~= nil then
1273 bp.Position = plr:GetMouse().Hit.p
1274 end
1275 end
1276 until attack == false
1277 end
1278end)
1279
1280Humanoid.WalkSpeed = 16
1281
1282Humanoid.Animator.Parent = nil
1283chara.Animate.Parent = nil
1284
1285local pos = Vector3.new(0,0,-50)
1286
1287local newMotor = function(part0, part1, c0, c1)
1288 local w = Create('Motor'){
1289 Parent = part0,
1290 Part0 = part0,
1291 Part1 = part1,
1292 C0 = c0,
1293 C1 = c1,
1294 }
1295 return w
1296end
1297
1298function clerp(a, b, t)
1299 return a:lerp(b, t)
1300end
1301
1302RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
1303NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
1304
1305local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
1306local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
1307local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
1308local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
1309RootJoint.C1 = CFrame.new(0, 0, 0)
1310RootJoint.C0 = CFrame.new(0, 0, 0)
1311Torso.Neck.C1 = CFrame.new(0, 0, 0)
1312Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
1313
1314
1315local rarmc1 = RW.C1
1316local larmc1 = LW.C1
1317local rlegc1 = RH.C1
1318local llegc1 = LH.C1
1319
1320local resetc1 = false
1321
1322function PlayAnimationFromTable(table, speed, bool)
1323 RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
1324 Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
1325 RW.C0 = clerp(RW.C0, table[3], speed)
1326 LW.C0 = clerp(LW.C0, table[4], speed)
1327 RH.C0 = clerp(RH.C0, table[5], speed)
1328 LH.C0 = clerp(LH.C0, table[6], speed)
1329 if bool == true then
1330 if resetc1 == false then
1331 resetc1 = true
1332 RootJoint.C1 = RootJoint.C1
1333 Torso.Neck.C1 = Torso.Neck.C1
1334 RW.C1 = rarmc1
1335 LW.C1 = larmc1
1336 RH.C1 = rlegc1
1337 LH.C1 = llegc1
1338 end
1339 end
1340end
1341
1342
1343frame = 0.03333333333333
1344tf = 0
1345allowframeloss = false
1346tossremainder = false
1347lastframe = tick()
1348game:GetService("RunService").Heartbeat:connect(function(s, p)
1349 tf = tf + s
1350 if tf >= frame then
1351 if allowframeloss then
1352 lastframe = tick()
1353 else
1354 lastframe = tick()
1355 end
1356 if tossremainder then
1357 tf = 0
1358 else
1359 tf = tf - frame * math.floor(tf / frame)
1360 end
1361 end
1362end)
1363function swait(num)
1364 if num == 0 or num == nil then
1365 game:GetService("RunService").Heartbeat:Wait()
1366 else
1367 for i = 0, num do
1368 game:GetService("RunService").Heartbeat:Wait()
1369 end
1370 end
1371end
1372
1373function RemoveOutlines(part)
1374 part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
1375end
1376
1377
1378CFuncs = {
1379 ["Part"] = {
1380 Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
1381 local Part = Create("Part"){
1382 Parent = Parent,
1383 Reflectance = Reflectance,
1384 Transparency = Transparency,
1385 CanCollide = false,
1386 Locked = true,
1387 BrickColor = BrickColor.new(tostring(BColor)),
1388 Name = Name,
1389 Size = Size,
1390 Material = Material,
1391 }
1392 RemoveOutlines(Part)
1393 return Part
1394 end;
1395 };
1396
1397 ["Mesh"] = {
1398 Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
1399 local Msh = Create(Mesh){
1400 Parent = Part,
1401 Offset = OffSet,
1402 Scale = Scale,
1403 }
1404 if Mesh == "SpecialMesh" then
1405 Msh.MeshType = MeshType
1406 Msh.MeshId = MeshId
1407 end
1408 return Msh
1409 end;
1410 };
1411
1412 ["Mesh"] = {
1413 Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
1414 local Msh = Create(Mesh){
1415 Parent = Part,
1416 Offset = OffSet,
1417 Scale = Scale,
1418 }
1419 if Mesh == "SpecialMesh" then
1420 Msh.MeshType = MeshType
1421 Msh.MeshId = MeshId
1422 end
1423 return Msh
1424 end;
1425 };
1426
1427 ["Weld"] = {
1428 Create = function(Parent, Part0, Part1, C0, C1)
1429 local Weld = Create("Weld"){
1430 Parent = Parent,
1431 Part0 = Part0,
1432 Part1 = Part1,
1433 C0 = C0,
1434 C1 = C1,
1435 }
1436 return Weld
1437 end;
1438 };
1439
1440 ["ParticleEmitter"] = {
1441 Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
1442 local fp = Create("ParticleEmitter"){
1443 Parent = Parent,
1444 Color = ColorSequence.new(Color1, Color2),
1445 LightEmission = LightEmission,
1446 Size = Size,
1447 Texture = Texture,
1448 Transparency = Transparency,
1449 ZOffset = ZOffset,
1450 Acceleration = Accel,
1451 Drag = Drag,
1452 LockedToPart = LockedToPart,
1453 VelocityInheritance = VelocityInheritance,
1454 EmissionDirection = EmissionDirection,
1455 Enabled = Enabled,
1456 Lifetime = LifeTime,
1457 Rate = Rate,
1458 Rotation = Rotation,
1459 RotSpeed = RotSpeed,
1460 Speed = Speed,
1461 VelocitySpread = VelocitySpread,
1462 }
1463 return fp
1464 end;
1465 };
1466
1467 CreateTemplate = {
1468
1469 };
1470}
1471
1472
1473function so(id,par,pit,vol)
1474 local sou = Instance.new("Sound", par or workspace)
1475 if par == chara then
1476 sou.Parent = chara.Torso
1477 end
1478 sou.Volume = vol
1479 sou.Pitch = pit or 1
1480 sou.SoundId = "rbxassetid://" .. id
1481 sou.PlayOnRemove = true
1482 sou:Destroy()
1483end
1484
1485local mus = Instance.new("Sound",Head)
1486mus.Name = "mus"
1487mus.SoundId = "rbxassetid://345868687"
1488mus.Looped = true
1489mus.Volume = 1
1490mus:Play()
1491
1492New = function(Object, Parent, Name, Data)
1493 local Object = Instance.new(Object)
1494 for Index, Value in pairs(Data or {}) do
1495 Object[Index] = Value
1496 end
1497 Object.Parent = Parent
1498 Object.Name = Name
1499 return Object
1500end
1501
1502local PoliceHat = New("Part",chara,"PoliceHat",{BrickColor = BrickColor.new("Really black"),FormFactor = Enum.FormFactor.Plate,Size = Vector3.new(2, 0.400000006, 1),CFrame = CFrame.new(18.3999939, 1.20000005, -23.1000061, -1, 0, 0, 0, 1, 0, 0, 0, -1),CanCollide = false,BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
1503local Mesh = New("SpecialMesh",PoliceHat,"Mesh",{Scale = Vector3.new(1.10000002, 1.20000005, 1.10000002),MeshId = "rbxassetid://1028788",TextureId = "rbxassetid://152240477",MeshType = Enum.MeshType.FileMesh,})
1504local Weld = New("ManualWeld",PoliceHat,"Weld",{Part0 = PoliceHat,Part1 = Head,C1 = CFrame.new(0, 0.700000048, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),})
1505for i, v in pairs(chara:children()) do
1506if v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors") then
1507v:Destroy()
1508elseif v.Name == "FakeHeadM" then
1509v.Ahoge.Mesh.Scale = Vector3.new()
1510elseif v.Name == "Chest" then
1511for a, b in pairs(v:children()) do
1512if b.Name ~= "Tail" then
1513b.Transparency = 1
1514end
1515end
1516end
1517end
1518local sh = Instance.new("Shirt",chara)
1519local pn = Instance.new("Pants",chara)
1520sh.ShirtTemplate = "rbxassetid://133284214"
1521pn.PantsTemplate = "rbxassetid://15224239"
1522
1523
1524bdefc0 = CFrame.new(.8,-1,0)*CFrame.Angles(math.rad(30),0,0)
1525gdefc0 = CFrame.new(-.8,-1,0)*CFrame.Angles(math.rad(130),0,0)
1526
1527local baton = Instance.new("Part",chara)
1528baton.Name = "Baton"
1529baton.Size = Vector3.new(.2,.2,3.2)
1530baton.BrickColor = BrickColor.new("Really black")
1531baton.CanCollide = false
1532CFuncs.Mesh.Create("SpecialMesh", baton, "FileMesh", "rbxassetid://11820238", Vector3.new(), Vector3.new(1.5,1.5,1.5))
1533
1534local bweld = Instance.new("Weld",baton)
1535bweld.Part0 = Torso
1536bweld.Part1 = baton
1537bweld.C0 = bdefc0
1538
1539local gun = Instance.new("Part", chara)
1540gun.Name = "Gun"
1541gun.Size = Vector3.new(.2,.2,.2)
1542gun.BrickColor = BrickColor.new("Really black")
1543gun.CanCollide = false
1544CFuncs.Mesh.Create("SpecialMesh", gun, "FileMesh", "rbxassetid://72012879", Vector3.new(), Vector3.new(2,2,2))
1545
1546local gweld = Instance.new("Weld", gun)
1547gweld.Part0 = Torso
1548gweld.Part1 = gun
1549gweld.C0 = gdefc0
1550
1551weld(pistol.Handle, gun)
1552weld(bat.Handle, baton)
1553
1554local att1 = Instance.new("Attachment",baton)
1555att1.Position = Vector3.new(-baton.Size.X/2,baton.Size.Y/2,baton.Size.Z/2)
1556local att2 = Instance.new("Attachment",baton)
1557att2.Position = Vector3.new(-baton.Size.X/2,-baton.Size.Y/2,-baton.Size.Z/2)
1558local tr1 = Instance.new("Trail",baton)
1559tr1.Color = ColorSequence.new(Color3.new(1,1,1))
1560tr1.Transparency = NumberSequence.new(0,1)
1561tr1.Lifetime = .5
1562tr1.Enabled = false
1563tr1.LightEmission = 1
1564tr1.Attachment0 = att1
1565tr1.Attachment1 = att2
1566local att3 = Instance.new("Attachment",RightLeg)
1567att3.Position = Vector3.new(0,1,0)
1568local att4 = Instance.new("Attachment",RightLeg)
1569att4.Position = Vector3.new(0,-1,0)
1570local tr2 = Instance.new("Trail",RightLeg)
1571tr2.Color = ColorSequence.new(Color3.new(1,1,1))
1572tr2.Transparency = NumberSequence.new(0,1)
1573tr2.Lifetime = .5
1574tr2.Enabled = false
1575tr2.LightEmission = 1
1576tr2.Attachment0 = att3
1577tr2.Attachment1 = att4
1578
1579function rayCast(Position, Direction, Range, Ignore)
1580 return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
1581end
1582
1583function mdmg(Part, Magnitude, HitType)
1584 for _, c in pairs(workspace:GetDescendants()) do
1585 local hum = c:FindFirstChildOfClass("Humanoid")
1586 if hum ~= nil then
1587 local head = c:FindFirstChild("UpperTorso") or c:FindFirstChild("Torso")
1588 if head ~= nil then
1589 local targ = head.Position - Part.Position
1590 local mag = targ.magnitude
1591 if mag <= Magnitude and c.Name ~= Player.Name and c:FindFirstChild("MagDmgd")==nil then
1592 if c.Name ~= chara then
1593 if c.Name ~= "CKbackup" or c.Name ~= "Nebula_Zorua" or c.Name ~= "Salvo_Starly" then
1594 local val = Instance.new("BoolValue",c)
1595 val.Name = "MagDmgd"
1596 local asd = Instance.new("ParticleEmitter",head)
1597 asd.Color = ColorSequence.new(Color3.new(1, 0, 0), Color3.new(.5, 0, 0))
1598 asd.LightEmission = .1
1599 asd.Size = NumberSequence.new(0.2)
1600 asd.Texture = "rbxassetid://771221224"
1601 aaa = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2),NumberSequenceKeypoint.new(1, 1)})
1602 bbb = NumberSequence.new({NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(0.0636, 0), NumberSequenceKeypoint.new(1, 1)})
1603 asd.Transparency = bbb
1604 asd.Size = aaa
1605 asd.ZOffset = .9
1606 asd.Acceleration = Vector3.new(0, -5, 0)
1607 asd.LockedToPart = false
1608 asd.EmissionDirection = "Back"
1609 asd.Lifetime = NumberRange.new(1, 2)
1610 asd.Rate = 1000
1611 asd.Rotation = NumberRange.new(-100, 100)
1612 asd.RotSpeed = NumberRange.new(-100, 100)
1613 asd.Speed = NumberRange.new(6)
1614 asd.VelocitySpread = 10000
1615 asd.Enabled = false
1616 asd:Emit(20)
1617 game:service'Debris':AddItem(asd,3)
1618 --Damage(head, head, MinimumDamage, MaximumDamage, KnockBack, Type, RootPart, .1, "rbxassetid://" .. HitSound, HitPitch)
1619 if HitType == "Blunt" then
1620 so(386946017,head,.95,3)
1621 game:service'Debris':AddItem(val,1)
1622 elseif HitType == "Shot" then
1623 so(144884872,head,.9,3)
1624 game:service'Debris':AddItem(val,.05)
1625 end
1626 local soaa = Instance.new("Sound",c.Head)
1627 soaa.Volume = .5
1628 local cho = math.random(1,5)
1629 if cho == 1 then
1630 soaa.SoundId = "rbxassetid://111896685"
1631 elseif cho == 2 then
1632 soaa.SoundId = "rbxassetid://535528169"
1633 elseif cho == 3 then
1634 soaa.SoundId = "rbxassetid://1080363252"
1635 elseif cho == 4 then
1636 soaa.SoundId = "rbxassetid://147758746"
1637 elseif cho == 5 then
1638 soaa.SoundId = "rbxassetid://626777433"
1639 soaa.Volume = .2
1640 soaa.TimePosition = 1
1641 end
1642 game:service'Debris':AddItem(soaa,6)
1643 soaa:Play()
1644 for i,v in pairs(c:children()) do
1645 if v:IsA("LocalScript") or v:IsA("Tool") then
1646 v:Destroy()
1647 end
1648 end
1649 hum.PlatformStand = true
1650 head.Velocity = RootPart.CFrame.lookVector*50
1651 head.RotVelocity = Vector3.new(10,0,0)
1652 chatfunc("Let that be a warning!")
1653 coroutine.wrap(function()
1654 swait(5)
1655 c:BreakJoints() end)()
1656 else
1657 end
1658 end
1659 end
1660 end
1661 end
1662 end
1663end
1664
1665--[[FindNearestTorso = function(pos)
1666 local list = (game.workspace:GetDescendants())
1667 local torso = nil
1668 local dist = 1000
1669 local temp, human, temp2 = nil, nil, nil
1670 for x = 1, #list do
1671 temp2 = list[x]
1672 if temp2.className == "Model" and temp2.Name ~= chara.Name then
1673 temp = temp2:findFirstChild("Torso")
1674 human = temp2:FindFirstChildOfClass("Humanoid")
1675 if temp ~= nil and human ~= nil and human.Health > 0 and (temp.Position - pos).magnitude < dist then
1676 local dohit = true
1677 if dohit == true then
1678 torso = temp
1679 dist = (temp.Position - pos).magnitude
1680 end
1681 end
1682 end
1683 end
1684 return torso, dist
1685end]]
1686
1687
1688function FindNearestTorso(Position, Distance, SinglePlayer)
1689 if SinglePlayer then
1690 return (SinglePlayer.Head.CFrame.p - Position).magnitude < Distance
1691 end
1692 local List = {}
1693 for i, v in pairs(workspace:GetDescendants()) do
1694 if v:IsA("Model") then
1695 if v:findFirstChild("Head") then
1696 if v ~= chara then
1697 if (v.Head.Position - Position).magnitude <= Distance then
1698 table.insert(List, v)
1699 end
1700 end
1701 end
1702 end
1703 end
1704 return List
1705end
1706
1707
1708--Chat Function--
1709function chatfunc(text)
1710coroutine.wrap(function()
1711if chara:FindFirstChild("TalkingBillBoard")~= nil then
1712chara:FindFirstChild("TalkingBillBoard"):destroy()
1713end
1714local naeeym2 = Instance.new("BillboardGui",chara)
1715naeeym2.Size = UDim2.new(0,100,0,40)
1716naeeym2.StudsOffset = Vector3.new(0,3,0)
1717naeeym2.Adornee = chara.Head
1718naeeym2.Name = "TalkingBillBoard"
1719local tecks2 = Instance.new("TextLabel",naeeym2)
1720tecks2.BackgroundTransparency = 1
1721tecks2.BorderSizePixel = 0
1722tecks2.Text = ""
1723tecks2.Font = "Fantasy"
1724tecks2.FontSize = "Size24"
1725tecks2.TextStrokeTransparency = 0
1726tecks2.TextColor3 = Color3.new(1,1,1)
1727tecks2.TextStrokeColor3 = Color3.new(0,0,0)
1728tecks2.Size = UDim2.new(1,0,0.5,0)
1729for i = 1,string.len(text),1 do
1730tecks2.Text = string.sub(text,1,i)
1731swait()
1732end
1733swait(30)
1734for i = 1, 5 do
1735swait()
1736tecks2.Position = tecks2.Position - UDim2.new(0,0,.05,0)
1737tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency +.2
1738tecks2.TextTransparency = tecks2.TextTransparency + .2
1739end
1740naeeym2:Destroy()
1741end)()
1742end
1743
1744
1745
1746EffectModel = Create("Model"){
1747 Parent = chara,
1748 Name = "Effects",
1749}
1750
1751
1752Effects = {
1753 Block = {
1754 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
1755 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
1756 prt.Anchored = true
1757 prt.CFrame = cframe
1758 local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1759 game:GetService("Debris"):AddItem(prt, 10)
1760 if Type == 1 or Type == nil then
1761 table.insert(Effects, {
1762 prt,
1763 "Block1",
1764 delay,
1765 x3,
1766 y3,
1767 z3,
1768 msh
1769 })
1770 elseif Type == 2 then
1771 table.insert(Effects, {
1772 prt,
1773 "Block2",
1774 delay,
1775 x3,
1776 y3,
1777 z3,
1778 msh
1779 })
1780 end
1781 end;
1782 };
1783
1784 Cylinder = {
1785 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1786 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
1787 prt.Anchored = true
1788 prt.CFrame = cframe
1789 local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1790 game:GetService("Debris"):AddItem(prt, 10)
1791 table.insert(Effects, {
1792 prt,
1793 "Cylinder",
1794 delay,
1795 x3,
1796 y3,
1797 z3,
1798 msh
1799 })
1800 end;
1801 };
1802 Head = {
1803 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1804 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
1805 prt.Anchored = true
1806 prt.CFrame = cframe
1807 local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Head", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1808 game:GetService("Debris"):AddItem(prt, 10)
1809 table.insert(Effects, {
1810 prt,
1811 "Cylinder",
1812 delay,
1813 x3,
1814 y3,
1815 z3,
1816 msh
1817 })
1818 end;
1819 };
1820
1821 Sphere = {
1822 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1823 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
1824 prt.Anchored = true
1825 prt.CFrame = cframe
1826 local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1827 game:GetService("Debris"):AddItem(prt, 10)
1828 table.insert(Effects, {
1829 prt,
1830 "Cylinder",
1831 delay,
1832 x3,
1833 y3,
1834 z3,
1835 msh
1836 })
1837 end;
1838 };
1839
1840 Elect = {
1841 Create = function(cff, x, y, z)
1842 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, BrickColor.new("Lime green"), "Part", Vector3.new(1, 1, 1))
1843 prt.Anchored = true
1844 prt.CFrame = cff * CFrame.new(math.random(-x, x), math.random(-y, y), math.random(-z, z))
1845 prt.CFrame = CFrame.new(prt.Position)
1846 game:GetService("Debris"):AddItem(prt, 2)
1847 local xval = math.random() / 2
1848 local yval = math.random() / 2
1849 local zval = math.random() / 2
1850 local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(xval, yval, zval))
1851 table.insert(Effects, {
1852 prt,
1853 "Elec",
1854 0.1,
1855 x,
1856 y,
1857 z,
1858 xval,
1859 yval,
1860 zval
1861 })
1862 end;
1863
1864 };
1865
1866 Ring = {
1867 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1868 local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
1869 prt.Anchored = true
1870 prt.CFrame = cframe
1871 local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1872 game:GetService("Debris"):AddItem(prt, 10)
1873 table.insert(Effects, {
1874 prt,
1875 "Cylinder",
1876 delay,
1877 x3,
1878 y3,
1879 z3,
1880 msh
1881 })
1882 end;
1883 };
1884
1885
1886 Wave = {
1887 Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1888 local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
1889 prt.Anchored = true
1890 prt.CFrame = cframe
1891 local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1892 game:GetService("Debris"):AddItem(prt, 10)
1893 table.insert(Effects, {
1894 prt,
1895 "Cylinder",
1896 delay,
1897 x3,
1898 y3,
1899 z3,
1900 msh
1901 })
1902 end;
1903 };
1904
1905 Break = {
1906 Create = function(brickcolor, cframe, x1, y1, z1)
1907 local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
1908 prt.Anchored = true
1909 prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
1910 local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1911 local num = math.random(10, 50) / 1000
1912 game:GetService("Debris"):AddItem(prt, 10)
1913 table.insert(Effects, {
1914 prt,
1915 "Shatter",
1916 num,
1917 prt.CFrame,
1918 math.random() - math.random(),
1919 0,
1920 math.random(50, 100) / 100
1921 })
1922 end;
1923 };
1924
1925 Fire = {
1926 Create = function(brickcolor, cframe, x1, y1, z1, delay)
1927 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
1928 prt.Anchored = true
1929 prt.CFrame = cframe
1930 msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1931 game:GetService("Debris"):AddItem(prt, 10)
1932 table.insert(Effects, {
1933 prt,
1934 "Fire",
1935 delay,
1936 1,
1937 1,
1938 1,
1939 msh
1940 })
1941 end;
1942 };
1943
1944 FireWave = {
1945 Create = function(brickcolor, cframe, x1, y1, z1)
1946 local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 1, brickcolor, "Effect", Vector3.new())
1947 prt.Anchored = true
1948 prt.CFrame = cframe
1949 msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1950 local d = Create("Decal"){
1951 Parent = prt,
1952 Texture = "rbxassetid://26356434",
1953 Face = "Top",
1954 }
1955 local d = Create("Decal"){
1956 Parent = prt,
1957 Texture = "rbxassetid://26356434",
1958 Face = "Bottom",
1959 }
1960 game:GetService("Debris"):AddItem(prt, 10)
1961 table.insert(Effects, {
1962 prt,
1963 "FireWave",
1964 1,
1965 30,
1966 math.random(400, 600) / 100,
1967 msh
1968 })
1969 end;
1970 };
1971
1972 Lightning = {
1973 Create = function(p0, p1, tym, ofs, col, th, tra, last)
1974 local magz = (p0 - p1).magnitude
1975 local curpos = p0
1976 local trz = {
1977 -ofs,
1978 ofs
1979 }
1980 for i = 1, tym do
1981 local li = CFuncs.Part.Create(EffectModel, "Neon", 0, tra or 0.4, col, "Ref", Vector3.new(th, th, magz / tym))
1982 local ofz = Vector3.new(trz[math.random(1, 2)], trz[math.random(1, 2)], trz[math.random(1, 2)])
1983 local trolpos = CFrame.new(curpos, p1) * CFrame.new(0, 0, magz / tym).p + ofz
1984 li.Material = "Neon"
1985 if tym == i then
1986 local magz2 = (curpos - p1).magnitude
1987 li.Size = Vector3.new(th, th, magz2)
1988 li.CFrame = CFrame.new(curpos, p1) * CFrame.new(0, 0, -magz2 / 2)
1989 table.insert(Effects, {
1990 li,
1991 "Disappear",
1992 last
1993 })
1994 else
1995 do
1996 do
1997 li.CFrame = CFrame.new(curpos, trolpos) * CFrame.new(0, 0, magz / tym / 2)
1998 curpos = li.CFrame * CFrame.new(0, 0, magz / tym / 2).p
1999 game.Debris:AddItem(li, 10)
2000 table.insert(Effects, {
2001 li,
2002 "Disappear",
2003 last
2004 })
2005 end
2006 end
2007 end
2008 end
2009 end
2010 };
2011
2012 EffectTemplate = {
2013
2014 };
2015}
2016
2017
2018function smek()
2019attack = true
2020bweld.Part0 = RightArm
2021bweld.C0 = CFrame.new(-.2,-2,.4)*CFrame.Angles(math.rad(90),0,math.rad(180))
2022Humanoid.WalkSpeed = 40
2023for i=0,1,.2 do
2024swait()
2025PlayAnimationFromTable({
2026CFrame.new(0, 0, 0, 0.499998987, 0, -0.866025984, 0, 1, 0, 0.866025984, 0, 0.499998987),
2027CFrame.new(0, 1.49999714, 0, 0.499998987, 0, 0.866025984, 0, 1, 0, -0.866025984, 0, 0.499998987),
2028CFrame.new(1.6195364, 0.256343663, -3.60019794e-06, 0.939692736, -0.342020124, -8.94069672e-08, 0.342020154, 0.939692676, -4.35416268e-07, 2.08616257e-07, 3.87430191e-07, 1),
2029CFrame.new(-1.65980804, 0.323206544, 5.72385352e-06, 0.866025329, 0.500000238, -2.98023224e-07, -0.500000179, 0.866025388, -1.34623383e-06, -4.47034836e-07, 1.29640102e-06, 1.00000012),
2030CFrame.new(0.500001073, -2.00000095, -1.57952309e-06, 0.939692616, 0, -0.342020184, 0, 1, 0, 0.342020184, 0, 0.939692616),
2031CFrame.new(-0.499998212, -2.00000095, 1.49011612e-06, 0.766043544, 0, 0.642788708, 0, 1, 0, -0.642788708, 0, 0.766043544),
2032}, .3, false)
2033end
2034Humanoid.WalkSpeed = 2
2035tr1.Enabled = true
2036so(536642316,baton,1,1)
2037for i=0,1,.1 do
2038swait()
2039PlayAnimationFromTable({
2040CFrame.new(-0.0116844922, 0, -0.381816059, 0.342019022, 0, 0.939693093, 0, 1, 0, -0.939693093, 0, 0.342018992),
2041CFrame.new(-0.0728889629, 1.49999714, 0.038963601, 0.342019022, 0, -0.939693093, 0, 1, 0, 0.939693093, 0, 0.342018992),
2042CFrame.new(1.06065702, 1.09677029, -0.161810428, 0.400286436, 0.242276207, 0.88378346, 0.734158754, -0.661962748, -0.151050553, 0.548435688, 0.709300876, -0.442843854),
2043CFrame.new(-1.59605861, 0.10887894, 1.11486224e-06, 0.984807909, 0.173648059, -2.23517418e-06, -0.173648059, 0.984807849, 3.82394944e-07, 2.29477882e-06, 1.86264515e-08, 1),
2044CFrame.new(0.685087919, -1.96527183, 0.0673596561, 0.92541647, -0.163175598, -0.342020869, 0.173647985, 0.984807849, 2.90093368e-07, 0.336824894, -0.0593915246, 0.939692438),
2045CFrame.new(-0.499999702, -2.00000095, 8.68737698e-06, 0.766045451, 0, 0.642786503, 0, 1, 0, -0.642786503, 0, 0.766045511),
2046}, .3, false)
2047chatfunc("Let that be a warning!")
2048end
2049swait(5)
2050bweld.Part0 = Torso
2051bweld.C0 = bdefc0
2052Humanoid.WalkSpeed = 16
2053tr1.Enabled = false
2054attack = false
2055end
2056
2057function asmek()
2058attack = true
2059--local par
2060--coroutine.wrap(function()
2061--repeat swait() par = rayCast(RootPart.Position,Vector3.new(0,-1,0),3,chara) until par~=nil or Torso.Velocity.Y == 0
2062--tr2.Enabled = false
2063--attack = false
2064--end)()
2065--for i=0,1,.2 do
2066--swait()
2067--PlayAnimationFromTable({
2068--CFrame.new(0, -0.0460019112, -0.0689063296, 1, 0, 0, 0, 0.984807849, 0.173647985, 0, -0.173647985, 0.984807849),
2069--CFrame.new(0, 1.52556431, -0.222140759, 1, 0, 0, 0, 0.939692676, 0.342020601, 0, -0.342020601, 0.939692676),
2070--CFrame.new(1.59158015, 0.575856388, 6.13234874e-07, 0.642787039, -0.766044974, -4.38231467e-07, 0.766045034, 0.642787039, 1.78813934e-07, 1.63912773e-07, -4.39584255e-07, 1.00000012),
2071--CFrame.new(-1.59158027, 0.575856209, 6.13234988e-07, 0.642787039, 0.766044974, 4.38231467e-07, -0.766045034, 0.642787039, 1.78813934e-07, -1.63912773e-07, -4.39584255e-07, 1.00000012),
2072--CFrame.new(0.499998927, -1.99999928, 3.81469772e-06, 1, 0, 0, 0, 1.00000012, 0, 0, 0, 1.00000012),
2073--CFrame.new(-0.5, -1.41182017, 0.232474089, 1, 0, 0, 0, 0.642786622, 0.766045392, 0, -0.766045392, 0.642786622),
2074--}, .3, false)
2075--end
2076tr2.Enabled = true
2077so(536642316,RightLeg,1,1)
2078for i=0,1.5,.1 do
2079swait()
2080PlayAnimationFromTable({
2081CFrame.new(0, -0.11843279, 0.00109164417, 1, 0, 0, 0, 0.76604414, -0.642788053, 0, 0.642788053, 0.76604414)*CFrame.Angles(math.rad(-360*i),0,0),
2082CFrame.new(0, 1.36002374, -0.491580963, 1, 0, 0, 0, 0.642787457, 0.766044736, 0, -0.766044736, 0.642787457),
2083CFrame.new(1.59157825, 0.575854659, 4.30346518e-06, 0.64278698, -0.766045034, -1.0103544e-07, 0.766045094, 0.64278698, -5.36441803e-07, 5.06639481e-07, 2.98023224e-07, 1.00000012),
2084CFrame.new(-1.59158015, 0.575855613, 2.39611677e-06, 0.64278698, 0.766045034, 1.0103544e-07, -0.766045094, 0.64278698, -5.36441803e-07, -5.06639481e-07, 2.98023224e-07, 1.00000012),
2085CFrame.new(0.399999022, -1.92074621, -0.716740668, 1, 0, 0, 0, 0.766044736, -0.642787457, 0, 0.642787457, 0.766044736),
2086CFrame.new(-0.5, -1.41181993, 0.232477784, 1, 0, 0, 0, 0.642787457, 0.766044736, 0, -0.766044736, 0.642787457),
2087}, .3, false)
2088if i >= .4 then
2089chatfunc("Let that be a warning!")
2090end
2091end
2092tr2.Enabled = false
2093attack = false
2094end
2095
2096local shots = 7
2097zhold = true
2098function shoot()
2099attackm = "gun"
2100attack = true
2101so(169799883,gun,1,1)
2102for i=0,1,.1 do
2103swait()
2104PlayAnimationFromTable({
2105CFrame.new(0.0524868444, 0, -0.0110093001, 0.64278698, 0, 0.766044974, 0, 1, 0, -0.766044974, 0, 0.64278698),
2106CFrame.new(-0.0421711877, 1.49999738, -0.0331315249, 0.852868021, -0.0612752885, -0.518518507, 0.17364794, 0.969846606, 0.171008661, 0.492404759, -0.235887513, 0.837791562),
2107CFrame.new(0.611007333, -0.00932076573, -0.639356554, 0.653100669, 0.696805716, -0.296515375, -0.748181939, 0.533255994, -0.394793421, -0.116975725, 0.479687244, 0.869607329),
2108CFrame.new(-1.29161143, -0.030067116, -0.0939707607, 0.98480773, -0.163176328, 0.0593894422, 0.173647985, 0.925416648, -0.336824149, 1.78813934e-06, 0.342019945, 0.939692736),
2109CFrame.new(0.499998003, -2.00000095, 3.84449959e-06, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
2110CFrame.new(-0.499998897, -2.00000095, 1.59442425e-06, 0.98480767, 0, 0.173648536, 0, 1, 0, -0.173648536, 0, 0.98480767),
2111}, .3, false)
2112end
2113Humanoid.WalkSpeed = 2
2114local ref = Instance.new("Part",chara)
2115ref.Size = Vector3.new(0,0,0)
2116ref.Anchored = true
2117ref.CanCollide = false
2118ref.Transparency = 1
2119gweld.Part0 = RightArm
2120gweld.C0 = CFrame.new(.1,-1.5,-.2)*CFrame.Angles(math.rad(180),math.rad(0),math.rad(-40))
2121chatfunc("Let that be a warning!")
2122for i=0,1,.1 do
2123swait()
2124PlayAnimationFromTable({
2125CFrame.new(0, -0.0301527902, -0.171009317, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2126CFrame.new(0.0984806046, 1.48289788, -0.00301507115, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2127CFrame.new(0.9734447, 0.943128467, -1.04116416, 0.76604414, 0.642788053, 0, 0.219846308, -0.262002349, -0.939692736, -0.604023278, 0.719846129, -0.342019886),
2128CFrame.new(-0.516993761, 0.475136518, -0.924885869, 0, -0.499998987, 0.866025984, 0.939692736, -0.29619813, -0.171009615, 0.342019886, 0.813798308, 0.469845414),
2129CFrame.new(0.5, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2130CFrame.new(-0.500000238, -1.99999905, 5.96046164e-08, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2131}, .3, false)
2132end
2133swait(5)
2134repeat
2135so(470245800,gun,1,1)
2136ref.CFrame = Mouse.Hit
2137local hitpt = Instance.new("Part",EffectModel)
2138hitpt.Size = Vector3.new(0,0,.3)
2139local bf = Instance.new("BodyVelocity",hitpt)
2140bf.P = 10000
2141bf.MaxForce = Vector3.new(bf.P,bf.P,bf.P)
2142game:service'Debris':AddItem(bf,.1)
2143hitpt.CFrame = gun.CFrame * CFrame.new(0,-.5,.5) * CFrame.Angles(math.rad(90),0,0)
2144bf.Velocity = Vector3.new(0,5,0) + RootPart.CFrame.rightVector*10
2145local hitm = Instance.new("SpecialMesh",hitpt)
2146hitm.MeshId = "http://www.roblox.com/asset/?id=94295100"
2147hitm.TextureId = "http://www.roblox.com/asset/?id=94287792"
2148hitm.Scale = Vector3.new(3,3,3.5)
2149coroutine.wrap(function()
2150swait(120)
2151for i = 0,1.1 do
2152swait()
2153hitpt.Transparency = i
2154end
2155hitpt:Destroy()
2156end)()
2157Effects.Block.Create(BrickColor.new("Bright yellow"), gun.CFrame*CFrame.new(0,.6,.3), 0,0,0,1,1,1, 0.05)
2158shots = shots - 1
2159for i=0,1,.2 do
2160swait()
2161PlayAnimationFromTable({
2162CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2163CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2164CFrame.new(0.973445654, 1.13885617, -0.660623372, 0.766044199, 0.642787933, 5.27496837e-08, 0.413175672, -0.492403269, -0.766045034, -0.492404401, 0.586824477, -0.64278698),
2165CFrame.new(-0.516991675, 0.65931946, -0.711421967, 0, -0.499999166, 0.866025925, 0.766044796, -0.556670487, -0.321393073, 0.642787218, 0.663414717, 0.383021772),
2166CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2167CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2168}, .3, false)
2169end
2170for i=0,1,.2 do
2171swait()
2172PlayAnimationFromTable({
2173CFrame.new(0, -0.0301527902, -0.171009317, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2174CFrame.new(0.0984806046, 1.48289788, -0.00301507115, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2175CFrame.new(0.9734447, 0.943128467, -1.04116416, 0.76604414, 0.642788053, 0, 0.219846308, -0.262002349, -0.939692736, -0.604023278, 0.719846129, -0.342019886),
2176CFrame.new(-0.516993761, 0.475136518, -0.924885869, 0, -0.499998987, 0.866025984, 0.939692736, -0.29619813, -0.171009615, 0.342019886, 0.813798308, 0.469845414),
2177CFrame.new(0.5, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2178CFrame.new(-0.500000238, -1.99999905, 5.96046164e-08, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2179}, .3, false)
2180end
2181if shots == 0 then
2182so(147323220,gun,1,1)
2183for i=0,1.3,.1 do
2184swait()
2185PlayAnimationFromTable({
2186CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2187CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2188CFrame.new(0.973445654, 1.13885617, -0.660623372, 0.766044199, 0.642787933, 5.27496837e-08, 0.413175672, -0.492403269, -0.766045034, -0.492404401, 0.586824477, -0.64278698),
2189CFrame.new(-1.29161143, -0.030067116, -0.0939707607, 0.98480773, -0.163176328, 0.0593894422, 0.173647985, 0.925416648, -0.336824149, 1.78813934e-06, 0.342019945, 0.939692736),
2190CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2191CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2192}, .3, false)
2193end
2194local MagPartt = New("Part",chara,"MagPart",{BrickColor = BrickColor.new("Really black"),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000033, 0.399999976, 1),CFrame = CFrame.new(-9.29999638, 0.700002313, -0.200002074, 1, 0, 0, 0, 0, 1, 0, -1, 0),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
2195MagPartt.CFrame = gun.CFrame * CFrame.new(0,-.5,-.5) * CFrame.Angles(0,0,0)
2196coroutine.wrap(function()
2197swait(5)
2198MagPartt.CanCollide = true
2199swait(120)
2200for i = 0,1.1 do
2201swait()
2202MagPartt.Transparency = i
2203end
2204MagPartt:Destroy()
2205end)()
2206swait(10)
2207local MagPart = New("Part",chara,"MagPart",{BrickColor = BrickColor.new("Really black"),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(.2,.4,1),CFrame = CFrame.new(-9.29999638, 0.700002313, -0.200002074, 1, 0, 0, 0, 0, 1, 0, -1, 0),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
2208local Weld = New("ManualWeld",MagPart,"Weld",{Part0 = MagPart,Part1 = chara["Left Arm"],C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0)*CFrame.Angles(math.rad(90),math.rad(90),math.rad(0)),C1 = CFrame.new(0.200001717, -1.20000005, -0.200000286, 1, 0, 0, 0, 0, 1, 0, -1, 0),})
2209for i=0,1.4,.2 do
2210swait()
2211PlayAnimationFromTable({
2212CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2213CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2214CFrame.new(0.973445654, 1.13885617, -0.660623372, 0.766044199, 0.642787933, 5.27496837e-08, 0.413175672, -0.492403269, -0.766045034, -0.492404401, 0.586824477, -0.64278698),
2215CFrame.new(-0.516991675, 0.65931946, -0.711421967, 0, -0.499999166, 0.866025925, 0.766044796, -0.556670487, -0.321393073, 0.642787218, 0.663414717, 0.383021772),
2216CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2217CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2218}, .3, false)
2219end
2220MagPart:Destroy()
2221swait(5)
2222for i=0,1,.2 do
2223swait()
2224PlayAnimationFromTable({
2225CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2226CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2227CFrame.new(1.16020393, 0.666379213, -0.905047119, 0.76604414, 0.604023218, 0.219846413, 0.219846308, 0.0751920938, -0.972632408, -0.604023278, 0.793411791, -0.0751917362),
2228CFrame.new(-0.629211903, 0.930547178, -0.87133497, 0.262002915, -0.642787874, -0.71984607, -0.958213985, -0.262002975, -0.114805877, -0.114805937, 0.71984601, -0.684573948),
2229CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2230CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2231}, .3, false)
2232end
2233so(506273075,gun,1,1)
2234for i=0,1,.2 do
2235swait()
2236PlayAnimationFromTable({
2237CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2238CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2239CFrame.new(1.16020393, 0.666379213, -0.905047119, 0.76604414, 0.604023218, 0.219846413, 0.219846308, 0.0751920938, -0.972632408, -0.604023278, 0.793411791, -0.0751917362),
2240CFrame.new(-0.629361629, 0.793605626, -0.495871037, 0.262002915, -0.642787874, -0.71984607, -0.958213985, -0.262002975, -0.114805877, -0.114805937, 0.71984601, -0.684573948),
2241CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2242CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2243}, .3, false)
2244end
2245for i=0,1,.2 do
2246swait()
2247PlayAnimationFromTable({
2248CFrame.new(0, -0.0301530343, -0.171007201, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2249CFrame.new(0.0984815434, 1.48289728, -0.00301322341, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2250CFrame.new(1.16020393, 0.666379213, -0.905047119, 0.76604414, 0.604023218, 0.219846413, 0.219846308, 0.0751920938, -0.972632408, -0.604023278, 0.793411791, -0.0751917362),
2251CFrame.new(-0.629211903, 0.930547178, -0.87133497, 0.262002915, -0.642787874, -0.71984607, -0.958213985, -0.262002975, -0.114805877, -0.114805937, 0.71984601, -0.684573948),
2252CFrame.new(0.499999523, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2253CFrame.new(-0.500000954, -1.99999809, -1.84774399e-06, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2254}, .3, false)
2255end
2256shots = 7
2257swait(10)
2258for i=0,1,.2 do
2259swait()
2260PlayAnimationFromTable({
2261CFrame.new(0, -0.0301527902, -0.171009317, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736),
2262CFrame.new(0.0984806046, 1.48289788, -0.00301507115, 0.984807849, 0.173648134, -3.13053391e-07, -0.171010122, 0.969846427, -0.173647895, -0.0301533248, 0.171009824, 0.984807849),
2263CFrame.new(0.9734447, 0.943128467, -1.04116416, 0.76604414, 0.642788053, 0, 0.219846308, -0.262002349, -0.939692736, -0.604023278, 0.719846129, -0.342019886),
2264CFrame.new(-0.516993761, 0.475136518, -0.924885869, 0, -0.499998987, 0.866025984, 0.939692736, -0.29619813, -0.171009615, 0.342019886, 0.813798308, 0.469845414),
2265CFrame.new(0.5, -1.72638702, -0.751741886, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2266CFrame.new(-0.500000238, -1.99999905, 5.96046164e-08, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1),
2267}, .3, false)
2268end
2269end
2270until zhold == false
2271swait(5)
2272ref:Destroy()
2273so(211134014,gun,1,1)
2274for i=0,1,.1 do
2275swait()
2276PlayAnimationFromTable({
2277CFrame.new(0.0524868444, 0, -0.0110093001, 0.64278698, 0, 0.766044974, 0, 1, 0, -0.766044974, 0, 0.64278698),
2278CFrame.new(-0.0421711877, 1.49999738, -0.0331315249, 0.852868021, -0.0612752885, -0.518518507, 0.17364794, 0.969846606, 0.171008661, 0.492404759, -0.235887513, 0.837791562),
2279CFrame.new(0.611007333, -0.00932076573, -0.639356554, 0.653100669, 0.696805716, -0.296515375, -0.748181939, 0.533255994, -0.394793421, -0.116975725, 0.479687244, 0.869607329),
2280CFrame.new(-1.29161143, -0.030067116, -0.0939707607, 0.98480773, -0.163176328, 0.0593894422, 0.173647985, 0.925416648, -0.336824149, 1.78813934e-06, 0.342019945, 0.939692736),
2281CFrame.new(0.499998003, -2.00000095, 3.84449959e-06, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
2282CFrame.new(-0.499998897, -2.00000095, 1.59442425e-06, 0.98480767, 0, 0.173648536, 0, 1, 0, -0.173648536, 0, 0.98480767),
2283}, .3, false)
2284end
2285gweld.Part0 = Torso
2286gweld.C0 = gdefc0
2287Humanoid.WalkSpeed = 16
2288attack = false
2289end
2290
2291qhold = false
2292justsprinted = false
2293function sprint()
2294attack = true
2295--print("supurinto?")
2296--justsprinted = true
2297--coroutine.wrap(function()
2298--swait(10)
2299--justsprinted = false
2300--end)()
2301repeat
2302swait()
2303PlayAnimationFromTable({
2304CFrame.new(-2.4138464e-07, 0.123327732, -0.188363045, 1, -4.38293796e-07, 1.20420327e-06, 0, 0.939692736, 0.342019886, -1.28148622e-06, -0.342019916, 0.939692736) * CFrame.new(0, 0- .08 * math.cos((sine/2.5)), 0),
2305CFrame.new(0, 1.41422474, 0.0894482136, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736),
2306CFrame.new(1.54809988, 0.041232653, 1.35168499e-08, 0.996376455, -0.0850530341, -3.41060513e-13, 0.0850530341, 0.996376455, 4.47034836e-07, 2.78823862e-08, 3.26637689e-07, 1.00000024) * CFrame.new(0, 0, -.6 * math.cos((sine) / 2.5)) * CFrame.Angles(math.rad(0 + 60 * math.cos((sine) / 2.5)), 0, 0),
2307CFrame.new(-1.53598976, 0.0413191095, -1.86092848e-06, 0.995650649, 0.0931596532, -2.61508148e-07, -0.0931649953, 0.995651186, -1.00695124e-05, -7.49969331e-07, 1.08217946e-05, 1.00000024) * CFrame.new(0, 0, .6 * math.cos((sine) / 2.5)) * CFrame.Angles(math.rad(0 - 60 * math.cos((sine) / 2.5)), 0, 0),
2308CFrame.new(0.540300786, -1.99793816, -9.82598067e-07, 0.998698533, -0.0510031395, 6.36324955e-07, 0.0510031395, 0.998698533, -1.00461093e-05, -8.35937328e-08, 1.08393433e-05, 1.00000024) * CFrame.new(0, 0, 0+ 1 * math.cos((sine) / 2.5)) * CFrame.Angles(math.rad(0 - 60 * math.cos((sine) / 2.5)), 0, 0),
2309CFrame.new(-0.539563596, -1.99794078, 1.12228372e-06, 0.998635888, 0.0523072146, -1.77852357e-07, -0.0523072146, 0.998635888, -1.00715051e-05, -3.89727461e-07, 1.08406466e-05, 1.00000024) * CFrame.new(0, 0, 0- 1 * math.cos((sine) / 2.5)) * CFrame.Angles(math.rad(0 + 60 * math.cos((sine) / 2.5)), 0, 0),
2310}, .3, false)
2311Humanoid.WalkSpeed = 40
2312until qhold == false or Torso.Velocity == Vector3.new(0,0,0)
2313--print'sutoppu'
2314Humanoid.WalkSpeed = 16
2315attack = false
2316end
2317
2318Mouse.Button1Down:connect(function()
2319 if attack == false then
2320 attackm = "baton"
2321 if Anim == "Jump" or Anim == "Fall" then
2322 asmek()
2323 else
2324 smek()
2325 end
2326 end
2327end)
2328
2329local sprintt = 0
2330
2331
2332Mouse.KeyDown:connect(function(k)
2333 k = k:lower()
2334 if k=='m' then
2335 if mus.IsPlaying == true then
2336 mus:Stop()
2337 elseif mus.IsPaused == true then
2338 mus:Play()
2339 end
2340 end
2341 if attack == false then
2342 if k == 'q' then
2343 qhold = true
2344 sprint()
2345 elseif k == 'z' then
2346 zhold = true
2347 shoot()
2348 end
2349 end
2350end)
2351
2352
2353Mouse.KeyUp:connect(function(k)
2354 k = k:lower()
2355 if k == 'q' then
2356 qhold = false
2357 elseif k == 'z' then
2358 zhold = false
2359 end
2360end)
2361
2362
2363coroutine.wrap(function()
2364while 1 do
2365swait()
2366if doe <= 360 then
2367 doe = doe + 2
2368else
2369 doe = 0
2370end
2371end
2372end)()
2373while true do
2374 swait()
2375 for i, v in pairs(chara:GetChildren()) do
2376 if v:IsA("Part") then
2377 v.Material = "SmoothPlastic"
2378 elseif v:IsA("Accessory") then
2379 v:WaitForChild("Handle").Material = "SmoothPlastic"
2380 end
2381 end
2382while true do
2383swait()
2384 if sprintt >= 1 then
2385 sprintt = sprintt - 1
2386 end
2387
2388 if Head:FindFirstChild("mus")==nil then
2389 mus = Instance.new("Sound",Head)
2390 mus.Name = "mus"
2391 mus.SoundId = "rbxassetid://345868687"
2392 mus.Looped = true
2393 mus.Volume = 1
2394 mus:Play()
2395 end
2396 Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
2397 velocity = RootPart.Velocity.y
2398 sine = sine + change
2399 local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, chara)
2400 if RootPart.Velocity.y > 1 and hit == nil then
2401 Anim = "Jump"
2402 if attack == false then
2403 PlayAnimationFromTable({
2404CFrame.new(0, 0.0382082276, -0.0403150208, 1, 0, 0, 0, 0.984807849, 0.173647985, 0, -0.173647985, 0.984807849),
2405CFrame.new(0, 1.46579528, 0.0939689279, 1, 0, 0, 0, 0.939692855, -0.342019796, 0, 0.342019796, 0.939692855),
2406CFrame.new(1.20945489, -0.213504896, 3.55388607e-07, 0.939692736, 0.342019916, 1.53461215e-07, -0.342019945, 0.939692736, 1.93715096e-07, -8.56816769e-08, -2.23517418e-07, 1.00000012),
2407CFrame.new(-1.20945573, -0.213503733, 5.0439985e-07, 0.939692736, -0.342019916, -1.53461215e-07, 0.342019945, 0.939692736, 1.93715096e-07, 8.56816769e-08, -2.23517418e-07, 1.00000012),
2408CFrame.new(0.5, -1.99739456, -0.0180913229, 1, 0, 0, 0, 1.00000012, 0, 0, 0, 1.00000012),
2409CFrame.new(-0.5, -1.30000103, -0.39999947, 1, 0, 0, 0, 0.939692676, 0.342020601, 0, -0.342020601, 0.939692676),
2410 }, .3, false)
2411 end
2412 elseif RootPart.Velocity.y < -1 and hit == nil then
2413 Anim = "Fall"
2414 if attack == false then
2415 PlayAnimationFromTable({
2416CFrame.new(0, -0.0646628663, 0.0399149321, 1, 0, 0, 0, 0.984807849, -0.173647985, 0, 0.173647985, 0.984807849),
2417CFrame.new(0, 1.4913609, -0.128171027, 1, 0, 0, 0, 0.939692855, 0.342019796, 0, -0.342019796, 0.939692855),
2418CFrame.new(1.55285025, 0.466259956, -9.26282269e-08, 0.766043842, -0.642788351, -6.46188241e-08, 0.642788291, 0.766043961, -7.4505806e-08, 1.04308128e-07, 1.49011612e-08, 1.00000012),
2419CFrame.new(-1.5605253, 0.475036323, -2.10609159e-07, 0.766043842, 0.642788351, 6.46188241e-08, -0.642788291, 0.766043961, -7.4505806e-08, -1.04308128e-07, 1.49011612e-08, 1.00000012),
2420CFrame.new(0.500000954, -1.9973948, -0.0180922765, 1, 0, 0, 0, 1.00000012, 0, 0, 0, 1.00000012),
2421CFrame.new(-0.499999046, -1.30000043, -0.400000483, 1, 0, 0, 0, 0.939692855, 0.342019796, 0, -0.342019796, 0.939692855),
2422 }, .3, false)
2423 end
2424 elseif Torsovelocity < 1 and hit ~= nil then
2425 Anim = "Idle"
2426 if attack == false then
2427 change = 1
2428 PlayAnimationFromTable({
2429CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0,.05 * math.cos((sine)/10), 0),
2430CFrame.new(0, 1.49999809, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
2431CFrame.new(0.89930898, -0.180769742, 0.30436784, 0.766043901, 0.642788172, 8.56792951e-07, -0.556670964, 0.663412929, 0.500000715, 0.321393967, -0.383022994, 0.866024971),
2432CFrame.new(-0.899309754, -0.180769712, 0.304367989, 0.766043901, -0.642788172, -8.56792951e-07, 0.556670964, 0.663412929, 0.500000715, -0.321393967, -0.383022994, 0.866024971),
2433CFrame.new(0.5, -1.99999893, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0,-.05 * math.cos((sine)/10), 0),
2434CFrame.new(-0.5, -1.99999893, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.new(0,-.05 * math.cos((sine)/10), 0),
2435 }, .3, false)
2436 end
2437 elseif Torsovelocity > 2 and hit ~= nil then
2438 Anim = "Walk"
2439 if attack == false then
2440 PlayAnimationFromTable({
2441CFrame.new(0, 0, 0, 1, -2.21689355e-12, -5.11591203e-13, -2.21689355e-12, 1, 7.74860496e-07, -5.11591203e-13, 7.74860496e-07, 1.00000048) * CFrame.new(0, 0- .08 * math.cos((sine) / 3.5), 0) * CFrame.Angles(0, 0, 0),
2442CFrame.new(-2.09923631e-14, 1.48262846, -0.0984891504, 1, -1.42108547e-14, 0, 0, 0.984807491, 0.173649743, 0, -0.173649758, 0.984807491),
2443CFrame.new(0.89930898, -0.180769742, 0.30436784, 0.766043901, 0.642788172, 8.56792951e-07, -0.556670964, 0.663412929, 0.500000715, 0.321393967, -0.383022994, 0.866024971),
2444CFrame.new(-0.899309754, -0.180769712, 0.304367989, 0.766043901, -0.642788172, -8.56792951e-07, 0.556670964, 0.663412929, 0.500000715, -0.321393967, -0.383022994, 0.866024971),
2445CFrame.new(0.540300786, -1.99793816, -9.82598067e-07, 0.998698533, -0.0510031395, 6.36324955e-07, 0.0510031395, 0.998698533, -1.00461093e-05, -8.35937328e-08, 1.08393433e-05, 1.00000024) * CFrame.new(0, 0, 0+ .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 - 30 * math.cos((sine) / 5)), 0, 0),
2446CFrame.new(-0.539563596, -1.99794078, 1.12228372e-06, 0.998635888, 0.0523072146, -1.77852357e-07, -0.0523072146, 0.998635888, -1.00715051e-05, -3.89727461e-07, 1.08406466e-05, 1.00000024) * CFrame.new(0, 0, 0- .5 * math.cos((sine) / 5)) * CFrame.Angles(math.rad(0 + 30 * math.cos((sine) / 5)), 0, 0),
2447 }, .3, false)
2448 end
2449 end
2450 if 0 < #Effects then
2451 for e = 1, #Effects do
2452 if Effects[e] ~= nil then
2453 local Thing = Effects[e]
2454 if Thing ~= nil then
2455 local Part = Thing[1]
2456 local Mode = Thing[2]
2457 local Delay = Thing[3]
2458 local IncX = Thing[4]
2459 local IncY = Thing[5]
2460 local IncZ = Thing[6]
2461 if Thing[2] == "Shoot" then
2462 local Look = Thing[1]
2463 local move = 30
2464 if Thing[8] == 3 then
2465 move = 10
2466 end
2467 local hit, pos = rayCast(Thing[4], Thing[1], move, m)
2468 if Thing[10] ~= nil then
2469 da = pos
2470 cf2 = CFrame.new(Thing[4], Thing[10].Position)
2471 cfa = CFrame.new(Thing[4], pos)
2472 tehCF = cfa:lerp(cf2, 0.2)
2473 Thing[1] = tehCF.lookVector
2474 end
2475 local mag = (Thing[4] - pos).magnitude
2476 Effects["Head"].Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0), 1, mag * 5, 1, 0.5, 0, 0.5, 0.2)
2477 if Thing[8] == 2 then
2478 Effects["Ring"].Create(Torso.BrickColor, CFrame.new((Thing[4] + pos) / 2, pos) * CFrame.Angles(1.57, 0, 0) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0), 1, 1, 0.1, 0.5, 0.5, 0.1, 0.1, 1)
2479 end
2480 Thing[4] = Thing[4] + Look * move
2481 Thing[3] = Thing[3] - 1
2482 if 2 < Thing[5] then
2483 Thing[5] = Thing[5] - 0.3
2484 Thing[6] = Thing[6] - 0.3
2485 end
2486 if hit ~= nil then
2487 Thing[3] = 0
2488 if Thing[8] == 1 or Thing[8] == 3 then
2489 Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
2490 else
2491 if Thing[8] == 2 then
2492 Damage(hit, hit, Thing[5], Thing[6], Thing[7], "Normal", RootPart, 0, "", 1)
2493 if (hit.Parent:FindFirstChildOfClass("Humanoid")) ~= nil or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid")) ~= nil then
2494 ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Really red"), "Reference", Vector3.new())
2495 ref.Anchored = true
2496 ref.CFrame = CFrame.new(pos)
2497 CFuncs["Sound"].Create("161006093", ref, 1, 1.2)
2498 game:GetService("Debris"):AddItem(ref, 0.2)
2499 Effects["Block"].Create(Torso.BrickColor, CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 1, 10, 10, 10, 0.1, 2)
2500 Effects["Ring"].Create(BrickColor.new("Bright yellow"), CFrame.new(ref.Position) * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 1, 0.1, 4, 4, 0.1, 0.1)
2501 MagnitudeDamage(ref, 15, Thing[5] / 1.5, Thing[6] / 1.5, 0, "Normal", "", 1)
2502 end
2503 end
2504 end
2505 ref = CFuncs.Part.Create(workspace, "Neon", 0, 1, BrickColor.new("Really red"), "Reference", Vector3.new())
2506 ref.Anchored = true
2507 ref.CFrame = CFrame.new(pos)
2508 Effects["Sphere"].Create(Torso.BrickColor, CFrame.new(pos), 5, 5, 5, 1, 1, 1, 0.07)
2509 game:GetService("Debris"):AddItem(ref, 1)
2510 end
2511 if Thing[3] <= 0 then
2512 table.remove(Effects, e)
2513 end
2514 end
2515 do
2516 do
2517 if Thing[2] == "FireWave" then
2518 if Thing[3] <= Thing[4] then
2519 Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(0, 1, 0)
2520 Thing[3] = Thing[3] + 1
2521 Thing[6].Scale = Thing[6].Scale + Vector3.new(Thing[5], 0, Thing[5])
2522 else
2523 Part.Parent = nil
2524 table.remove(Effects, e)
2525 end
2526 end
2527 if Thing[2] ~= "Shoot" and Thing[2] ~= "Wave" and Thing[2] ~= "FireWave" then
2528 if Thing[1].Transparency <= 1 then
2529 if Thing[2] == "Block1" then
2530 Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
2531 Mesh = Thing[7]
2532 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
2533 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2534 else
2535 if Thing[2] == "Block2" then
2536 Thing[1].CFrame = Thing[1].CFrame
2537 Mesh = Thing[7]
2538 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
2539 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2540 else
2541 if Thing[2] == "Fire" then
2542 Thing[1].CFrame = CFrame.new(Thing[1].Position) + Vector3.new(0, 0.2, 0)
2543 Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
2544 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2545 else
2546 if Thing[2] == "Cylinder" then
2547 Mesh = Thing[7]
2548 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
2549 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2550 else
2551 if Thing[2] == "Blood" then
2552 Mesh = Thing[7]
2553 Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, 0.5, 0)
2554 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
2555 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2556 else
2557 if Thing[2] == "Elec" then
2558 Mesh = Thing[10]
2559 Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
2560 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2561 else
2562 if Thing[2] == "Disappear" then
2563 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2564 else
2565 if Thing[2] == "Shatter" then
2566 Thing[1].Transparency = Thing[1].Transparency + Thing[3]
2567 Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
2568 Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
2569 Thing[6] = Thing[6] + Thing[5]
2570 end
2571 end
2572 end
2573 end
2574 end
2575 end
2576 end
2577 end
2578 else
2579 Part.Parent = nil
2580 table.remove(Effects, e)
2581 end
2582 end
2583 end
2584 end
2585 end
2586 end
2587 end
2588 end
2589end
2590end