SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
2 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
3 | local RealPlayer = Player | |
4 | do print("FE Compatibility code by Mokiros");InternalData = {}InternalData.RealOwner = owner;InternalData.RealObjs = {};InternalData.SoundLoudness = {};local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end,__call=function(self,...)local t=rawget(self,"_RealService")if t then return t(...)end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return self[t]end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;x.RunService=v({RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")setmetatable(x,{__index=function(self,t)return r:GetService(t)or typeof(r[t])=="function"and function(m,...)return r[t](r,...)end or r[t]end,__newindex=s.__newindex,__call=s.__call})game,owner=x,x.Players.LocalPlayer | |
5 | script.Parent = InternalData.RealOwner.Character | |
6 | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput";InternalData.Event = Event | |
7 | local function createObject (connections, index) | |
8 | local proxy = newproxy (true);local meta = getmetatable (proxy); | |
9 | local runbind = function (self, i, ...) connections[i]:Fire (...); end; | |
10 | while (#connections > 0) do connections[table.remove(connections, 1)] = Instance.new ('BindableEvent');end; | |
11 | meta.__index = function (self, i) | |
12 | if (i == 'TriggerEvent') then return runbind end; | |
13 | return connections[i] and connections[i].Event or index[i]; | |
14 | end; | |
15 | meta.__newindex = index;meta.__metatable = false;return proxy | |
16 | end; | |
17 | local Mouse = createObject({"KeyUp","KeyDown","Button1Down","Button1Up"},{["Target"] = nil;["Hit"] = CFrame.new()}) | |
18 | local UserInputService = createObject({"InputBegan","InputEnded"},{}) | |
19 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
20 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
21 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
22 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
23 | if FiredBy ~= InternalData.RealOwner then return end | |
24 | if Input.MouseEvent then | |
25 | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit | |
26 | elseif Input.Sound then | |
27 | if InternalData.SoundLoudness[Input.Sound] then InternalData.SoundLoudness[Input.Sound] = Input.Loudness end | |
28 | else | |
29 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
30 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TriggerEvent(Begin and "Button1Down" or "Button1Up") end | |
31 | for _,Action in pairs(ContextActionService.Actions) do | |
32 | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end | |
33 | end | |
34 | Mouse:TriggerEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower());UserInputService:TriggerEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
35 | end | |
36 | end) | |
37 | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService | |
38 | Event.Parent = NLS([[ | |
39 | local Player = owner; | |
40 | local Sounds = {}; | |
41 | local Event = script:WaitForChild("UserInput"); | |
42 | local UserInputService = game:GetService("UserInputService"); | |
43 | local Mouse = Player:GetMouse(); | |
44 | local Input = function(Input,gameProcessedEvent) | |
45 | if gameProcessedEvent then return end | |
46 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
47 | end | |
48 | Event.OnClientEvent:connect(function(Args) | |
49 | if Args[1] == "NewSound" then table.insert(Sounds,Args[2]) end | |
50 | end) | |
51 | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) | |
52 | local Hit,Target | |
53 | while wait(1/30) do | |
54 | for x,Sound in pairs(Sounds) do | |
55 | if Sound.Parent then Event:FireServer({["Sound"]=Sound,["Loudness"]=Sound.PlaybackLoudness}) end | |
56 | end | |
57 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
58 | Hit = Mouse.Hit;Target = Mouse.Target; | |
59 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
60 | end | |
61 | end | |
62 | ]],InternalData.RealOwner.Character) | |
63 | end | |
64 | InternalData.NewOwner = setmetatable({},{ | |
65 | __index = function (self,Index) | |
66 | local Type = type(InternalData.RealOwner[Index]) | |
67 | if Type == "function" then | |
68 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
69 | return function (self)return InternalData["Mouse"] end | |
70 | end | |
71 | return function (self,...)return InternalData.RealOwner[Index](InternalData.RealOwner,...) end | |
72 | elseif Index == "FakePlayer" then | |
73 | return true | |
74 | end | |
75 | return InternalData.RealOwner[Index] | |
76 | end; | |
77 | __tostring = function(self) return tostring(InternalData.RealOwner) end | |
78 | }) | |
79 | --LoadLibrary("RbxUtility").Create | |
80 | InternalData.LoadLibrary = LoadLibrary;LoadLibrary = function(Library) | |
81 | if Library == "RbxUtility" then | |
82 | return setmetatable({},{ | |
83 | __tostring = function() return "RbxUtility" end; | |
84 | __index = function(self, Index) | |
85 | if Index:lower() == "create" then | |
86 | return function(Type) | |
87 | return function(Data) | |
88 | Data = Data or {} | |
89 | local Inst = Instance.new(Type) | |
90 | for x,y in pairs(Data) do | |
91 | if InternalData.RealObjs[y] then y = InternalData.RealObjs[y] end | |
92 | if y == owner then y = InternalData.RealOwner end | |
93 | Inst[x] = y | |
94 | end | |
95 | return Inst | |
96 | end | |
97 | end | |
98 | end | |
99 | return InternalData.LoadLibrary(Library)[Index] | |
100 | end | |
101 | }) | |
102 | end | |
103 | return InternalData.LoadLibrary(Library) | |
104 | end | |
105 | InternalData.RealInstance = Instance;Instance = setmetatable({},{ | |
106 | __index = function (self,Index) | |
107 | if Index:lower() == 'new' then | |
108 | return function (Type, Parent) | |
109 | if Parent == owner then Parent = InternalData.RealOwner end | |
110 | if InternalData.RealObjs[Parent] then Parent = InternalData.RealObjs[Parent] end | |
111 | local Real = InternalData.RealInstance.new(Type,Parent) | |
112 | if not Type then return end | |
113 | if Type == "BillboardGui" then | |
114 | local ToReturn = setmetatable({},{ | |
115 | __index = function (self,Index) | |
116 | if type(Real[Index]) == "function" then | |
117 | if Index:lower() == "clone" then | |
118 | return function (self) | |
119 | local Real = Real:Clone() | |
120 | local ToReturn = setmetatable({RealObject = Real},{ | |
121 | __index = function (self,Index) | |
122 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
123 | return Real[Index] | |
124 | end; | |
125 | __newindex = function (self,Index,Value) | |
126 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
127 | if Value == owner then Value = InternalData.RealOwner end | |
128 | Real[Index] = Value | |
129 | end; | |
130 | __tostring = function(self) return tostring(Real) end; | |
131 | }) | |
132 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
133 | end | |
134 | end | |
135 | return function (self,...) return Real[Index](Real,...)end | |
136 | end | |
137 | return Real[Index] | |
138 | end; | |
139 | __newindex = function (self,Index,Value) | |
140 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
141 | if Value == owner then Value = InternalData.RealOwner end | |
142 | Real[Index] = Value | |
143 | end; | |
144 | __tostring = function(self) return tostring(Real) end; | |
145 | }) | |
146 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
147 | elseif Type:lower() == "sound" then | |
148 | Real.Parent = owner.Character; | |
149 | local ToReturn = setmetatable({RealObject = Real},{ | |
150 | __index = function (self,Index) | |
151 | if Index:lower() == "playbackloudness" then | |
152 | return InternalData.SoundLoudness[Real] or 0 | |
153 | elseif type(Real[Index]) == "function" then | |
154 | if Index:lower() == "clone" then | |
155 | return function (self) | |
156 | local Real = Real:Clone() | |
157 | local ToReturn = setmetatable({},{ | |
158 | __index = function (self,Index) | |
159 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
160 | return Real[Index] | |
161 | end; | |
162 | __newindex = function (self,Index,Value) | |
163 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
164 | if Value == owner then Value = InternalData.RealOwner end | |
165 | Real[Index] = Value | |
166 | end; | |
167 | __tostring = function(self) return tostring(Real) end; | |
168 | }) | |
169 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
170 | end | |
171 | end | |
172 | return function (self,...) return Real[Index](Real,...)end | |
173 | end | |
174 | return Real[Index] | |
175 | end; | |
176 | __newindex = function (self,Index,Value) | |
177 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
178 | if Value == owner then Value = InternalData.RealOwner end | |
179 | Real[Index] = Value | |
180 | end; | |
181 | __tostring = function(self) return tostring(Real) end; | |
182 | }) | |
183 | InternalData.RealObjs[ToReturn] = Real;InternalData.SoundLoudness[Real] = 0;repeat wait() until InternalData.Event.Parent InternalData.Event:FireClient(InternalData.RealOwner,{"NewSound",Real}) return ToReturn; | |
184 | else | |
185 | local ToReturn = setmetatable({RealObject = Real},{ | |
186 | __index = function (self,Index) | |
187 | if type(Real[Index]) == "function" then | |
188 | if Index:lower() == "clone" then | |
189 | return function (self) | |
190 | local Real = Real:Clone() | |
191 | local ToReturn = setmetatable({},{ | |
192 | __index = function (self,Index) | |
193 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
194 | return Real[Index] | |
195 | end; | |
196 | __newindex = function (self,Index,Value) | |
197 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
198 | if Value == owner then Value = InternalData.RealOwner end | |
199 | Real[Index] = Value | |
200 | end; | |
201 | __tostring = function(self) return tostring(Real) end; | |
202 | }) | |
203 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
204 | end | |
205 | end | |
206 | return function (self,...) return Real[Index](Real,...)end | |
207 | end | |
208 | return Real[Index] | |
209 | end; | |
210 | __newindex = function (self,Index,Value) | |
211 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
212 | if Value == owner then Value = InternalData.RealOwner end | |
213 | Real[Index] = Value | |
214 | end; | |
215 | __tostring = function(self) return tostring(Real) end; | |
216 | }) | |
217 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
218 | end | |
219 | end | |
220 | end | |
221 | return InternalData.RealInstance[Index] | |
222 | end; | |
223 | __tostring = function(self) return tostring(InternalData.RealInstance) end; | |
224 | }); | |
225 | InternalData.RealGame = game;game = setmetatable({},{ | |
226 | __index = function (self,Index) | |
227 | if InternalData.RealGame[Index] then | |
228 | local Type = type(InternalData.RealGame[Index]) | |
229 | if Type == "function" then | |
230 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
231 | return function (self,Service) | |
232 | local FakeServices = { | |
233 | ["players"] = function() | |
234 | return setmetatable({},{ | |
235 | __index = function (self2,Index2) | |
236 | local RealService = InternalData.RealGame:GetService(Service) | |
237 | local Type2 = type(RealService[Index2]) | |
238 | if Type2 == "function" then | |
239 | return function (self,...) return RealService[Index2](RealService,...)end | |
240 | else | |
241 | if Index2:lower() == "localplayer" then return InternalData.NewOwner end | |
242 | return RealService[Index2] | |
243 | end | |
244 | end; | |
245 | __tostring = function(self) return tostring(InternalData.RealGame:GetService(Service)) end | |
246 | }) | |
247 | end; | |
248 | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; | |
249 | ["userinputservice"] = function() return InternalData["UserInputService"] end; | |
250 | ["debris"] = function() | |
251 | return setmetatable({},{ | |
252 | __index = function(self2,Index2) | |
253 | local RealService = InternalData.RealGame:GetService(Service) | |
254 | local Type2 = type(RealService[Index2]) | |
255 | if Type2 == "function" then | |
256 | if Index2:lower() == "additem" then | |
257 | return function (self,Item,Time) | |
258 | if InternalData.RealObjs[Item] then Item = InternalData.RealObjs[Item] end | |
259 | return RealService:AddItem(Item,Time) | |
260 | end | |
261 | end | |
262 | return function (self,...) return RealService[Index2](RealService,...) end | |
263 | end | |
264 | return RealService[Index2] | |
265 | end; | |
266 | __tostring = function(self) return tostring(InternalData.RealGame:GetService("Debris")) end | |
267 | }) | |
268 | end; | |
269 | ["runservice"] = function() | |
270 | return setmetatable({},{ | |
271 | __index = function(self2,Index2) | |
272 | local RealService = InternalData.RealGame:GetService(Service) | |
273 | local Type2 = type(RealService[Index2]) | |
274 | if Type2 == "function" then | |
275 | return function (self,...) return RealService[Index2](RealService,...) end | |
276 | else | |
277 | local RunServices = { | |
278 | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return InternalData.RealGame:GetService("RunService").Stepped:Connect(Function) end end; | |
279 | ["renderstepped"] = function() return RealService["Stepped"] end | |
280 | } | |
281 | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end | |
282 | return RealService[Index2] | |
283 | end | |
284 | end; | |
285 | __tostring = function(self) return tostring(InternalData.RealGame:GetService("RunService")) end | |
286 | }) | |
287 | end | |
288 | } | |
289 | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end | |
290 | return InternalData.RealGame:GetService(Service) | |
291 | end | |
292 | end | |
293 | return function (self,...) return InternalData.RealGame[Index](InternalData.RealGame,...) end | |
294 | else | |
295 | if game:GetService(Index) then return game:GetService(Index) end | |
296 | return InternalData.RealGame[Index] | |
297 | end | |
298 | end | |
299 | return nil | |
300 | end; | |
301 | __tostring = function(self) return tostring(InternalData.game) end | |
302 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete!") | |
303 | ||
304 | --StickJames Script Fixed By basstracker1970 | |
305 | local p = game.Players.LocalPlayer | |
306 | local char = p.Character | |
307 | local mouse = p:GetMouse() | |
308 | local larm = char["Left Arm"] | |
309 | local rarm = char["Right Arm"] | |
310 | local lleg = char["Left Leg"] | |
311 | local rleg = char["Right Leg"] | |
312 | local hed = char.Head | |
313 | local Torso = char.Torso | |
314 | local hitbox = char.Torso | |
315 | local hum = char.Humanoid | |
316 | local effect={} | |
317 | local cam = game.Workspace.CurrentCamera | |
318 | local root = char.HumanoidRootPart | |
319 | local deb = false | |
320 | local shot = 0 | |
321 | local potential = false | |
322 | local debris=game:service"Debris" | |
323 | local l = game:GetService("Lighting") | |
324 | local rs = game:GetService("RunService").RenderStepped | |
325 | ptz = {0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1} | |
326 | math.randomseed(os.time()) | |
327 | for i,v in pairs(char:children()) do | |
328 | if v:IsA("Accessory") then | |
329 | v:Destroy() | |
330 | end | |
331 | end | |
332 | char["Body Colors"].HeadColor = BrickColor.new("Really black") | |
333 | char["Body Colors"].LeftArmColor = BrickColor.new("Really black") | |
334 | char["Body Colors"].RightArmColor = BrickColor.new("Really black") | |
335 | char["Body Colors"].TorsoColor = BrickColor.new("Really black") | |
336 | char["Body Colors"].RightLegColor = BrickColor.new("Really black") | |
337 | char["Body Colors"].LeftLegColor = BrickColor.new("Really black") | |
338 | Player=game:GetService("Players").LocalPlayer | |
339 | Character=Player.Character | |
340 | PlayerGui=Player.PlayerGui | |
341 | Backpack=Player.Backpack | |
342 | Torso=Character.Torso | |
343 | Head=Character.Head | |
344 | Humanoid=Character.Humanoid | |
345 | Mouse=Player:GetMouse() | |
346 | RootPart = Character.HumanoidRootPart | |
347 | RootJoint = RootPart.RootJoint | |
348 | LeftArm=Character["Left Arm"] | |
349 | LeftLeg=Character["Left Leg"] | |
350 | RightArm=Character["Right Arm"] | |
351 | RightLeg=Character["Right Leg"] | |
352 | LS=Torso["Left Shoulder"] | |
353 | LH=Torso["Left Hip"] | |
354 | RS=Torso["Right Shoulder"] | |
355 | RH=Torso["Right Hip"] | |
356 | Neck=Torso.Neck | |
357 | it=Instance.new | |
358 | vt=Vector3.new | |
359 | cf=CFrame.new | |
360 | euler=CFrame.fromEulerAnglesXYZ | |
361 | angles=CFrame.Angles | |
362 | local decreaseatk=0 | |
363 | local decreasedef=0 | |
364 | local decreasemvmt=0 | |
365 | local Anim="Idle" | |
366 | local Effects={} | |
367 | local armorparts={} | |
368 | local armorwelds={} | |
369 | local weaponparts={} | |
370 | local weaponwelds={} | |
371 | local necko=euler(0,0,0)*cf(0,1,0) | |
372 | local attack=false | |
373 | local jump=false | |
374 | local start=false | |
375 | local move=10 | |
376 | local hitfloor,posfloor=nil,nil | |
377 | local run=Instance.new("NumberValue") | |
378 | run.Name="DecreaseMvmt" | |
379 | run.Value=-1.2 | |
380 | local bName="Sthomas" | |
381 | local MainColor=BrickColor.new("Really black") | |
382 | local SubColor=BrickColor.new("Really black") | |
383 | --[[if script:findFirstChild("SiegmundHealth")~=nil then | |
384 | for _,c in pairs(game.Players:children()) do | |
385 | d=script.SiegmundHealth:Clone() | |
386 | d.Parent=c.PlayerGui | |
387 | end | |
388 | end]] | |
389 | RW, LW=Instance.new("Motor"), Instance.new("Motor") | |
390 | RW.Name="Right Shoulder" LW.Name="Left Shoulder" | |
391 | ||
392 | ||
393 | ||
394 | function NoOutline(Part) | |
395 | Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10 | |
396 | end | |
397 | Character.Animate:Remove() | |
398 | ||
399 | Character.Humanoid.Animator:Remove() | |
400 | local Create = LoadLibrary("RbxUtility").Create | |
401 | ||
402 | ArtificialHB = Create("BindableEvent", script){ | |
403 | Parent = script, | |
404 | Name = "Heartbeat", | |
405 | } | |
406 | ||
407 | script:WaitForChild("Heartbeat") | |
408 | ||
409 | frame = 1 / 30 | |
410 | tf = 0 | |
411 | allowframeloss = false | |
412 | tossremainder = false | |
413 | lastframe = tick() | |
414 | script.Heartbeat:Fire() | |
415 | ||
416 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
417 | tf = tf + s | |
418 | if tf >= frame then | |
419 | if allowframeloss then | |
420 | script.Heartbeat:Fire() | |
421 | lastframe = tick() | |
422 | else | |
423 | for i = 1, math.floor(tf / frame) do | |
424 | script.Heartbeat:Fire() | |
425 | end | |
426 | lastframe = tick() | |
427 | end | |
428 | if tossremainder then | |
429 | tf = 0 | |
430 | else | |
431 | tf = tf - frame * math.floor(tf / frame) | |
432 | end | |
433 | end | |
434 | end) | |
435 | ||
436 | function swait(num) | |
437 | if num == 0 or num == nil then | |
438 | ArtificialHB.Event:wait() | |
439 | else | |
440 | for i = 0, num do | |
441 | ArtificialHB.Event:wait() | |
442 | end | |
443 | end | |
444 | end | |
445 | ||
446 | --[[frame,t,lastframe = 1/30,0,tick() | |
447 | allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame*2 or greater. | |
448 | tossremainder = false --if set to true t will be set to 0 after Fire()-ing. | |
449 | ||
450 | swait = function(dt) | |
451 | if dt == nil then | |
452 | dt = frame | |
453 | elseif dt < frame then | |
454 | dt = frame | |
455 | elseif dt > frame then | |
456 | --round this out into frames | |
457 | dt = math.floor(dt/frame) | |
458 | end | |
459 | local timetomeet = tick() + dt | |
460 | end]] --maybe later | |
461 | ||
462 | --30hz Pacemaker | |
463 | ||
464 | script:WaitForChild("Heartbeat") | |
465 | ||
466 | frame = 1/30 | |
467 | tf = 0 | |
468 | allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame*2 or greater. | |
469 | tossremainder = false --if set to true t will be set to 0 after Fire()-ing. | |
470 | lastframe = tick() | |
471 | script.Heartbeat:Fire() --ayy lmao | |
472 | ||
473 | game:GetService("RunService").Heartbeat:connect(function(s,p) --herp derp | |
474 | tf = tf + s | |
475 | if tf >= frame then | |
476 | if allowframeloss then | |
477 | script.Heartbeat:Fire() | |
478 | lastframe=tick() | |
479 | else | |
480 | --print("FIRED "..math.floor(t/frame).." FRAME(S)","REMAINDER "..(t - frame*(math.floor(t/frame)))) | |
481 | for i=1, math.floor(tf/frame) do | |
482 | script.Heartbeat:Fire() | |
483 | end | |
484 | lastframe=tick() | |
485 | end | |
486 | if tossremainder then | |
487 | tf = 0 | |
488 | else | |
489 | tf = tf - frame * math.floor(tf/frame) | |
490 | end | |
491 | end | |
492 | end) | |
493 | ||
494 | function clerp(a,b,t) | |
495 | local qa = {QuaternionFromCFrame(a)} | |
496 | local qb = {QuaternionFromCFrame(b)} | |
497 | local ax, ay, az = a.x, a.y, a.z | |
498 | local bx, by, bz = b.x, b.y, b.z | |
499 | local _t = 1-t | |
500 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
501 | end | |
502 | ||
503 | function QuaternionFromCFrame(cf) | |
504 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
505 | local trace = m00 + m11 + m22 | |
506 | if trace > 0 then | |
507 | local s = math.sqrt(1 + trace) | |
508 | local recip = 0.5/s | |
509 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
510 | else | |
511 | local i = 0 | |
512 | if m11 > m00 then | |
513 | i = 1 | |
514 | end | |
515 | if m22 > (i == 0 and m00 or m11) then | |
516 | i = 2 | |
517 | end | |
518 | if i == 0 then | |
519 | local s = math.sqrt(m00-m11-m22+1) | |
520 | local recip = 0.5/s | |
521 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
522 | elseif i == 1 then | |
523 | local s = math.sqrt(m11-m22-m00+1) | |
524 | local recip = 0.5/s | |
525 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
526 | elseif i == 2 then | |
527 | local s = math.sqrt(m22-m00-m11+1) | |
528 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
529 | end | |
530 | end | |
531 | end | |
532 | ||
533 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
534 | local xs, ys, zs = x + x, y + y, z + z | |
535 | local wx, wy, wz = w*xs, w*ys, w*zs | |
536 | local xx = x*xs | |
537 | local xy = x*ys | |
538 | local xz = x*zs | |
539 | local yy = y*ys | |
540 | local yz = y*zs | |
541 | local zz = z*zs | |
542 | return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) | |
543 | end | |
544 | ||
545 | function QuaternionSlerp(a, b, t) | |
546 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
547 | local startInterp, finishInterp; | |
548 | if cosTheta >= 0.0001 then | |
549 | if (1 - cosTheta) > 0.0001 then | |
550 | local theta = math.acos(cosTheta) | |
551 | local invSinTheta = 1/math.sin(theta) | |
552 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
553 | finishInterp = math.sin(t*theta)*invSinTheta | |
554 | else | |
555 | startInterp = 1-t | |
556 | finishInterp = t | |
557 | end | |
558 | else | |
559 | if (1+cosTheta) > 0.0001 then | |
560 | local theta = math.acos(-cosTheta) | |
561 | local invSinTheta = 1/math.sin(theta) | |
562 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
563 | finishInterp = math.sin(t*theta)*invSinTheta | |
564 | else | |
565 | startInterp = t-1 | |
566 | finishInterp = t | |
567 | end | |
568 | end | |
569 | return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp | |
570 | end | |
571 | ||
572 | function part(formfactor,parent,reflectance,transparency,brickcolor,name,size) | |
573 | local fp=it("Part") | |
574 | fp.formFactor=formfactor | |
575 | fp.Parent=parent | |
576 | fp.Reflectance=reflectance | |
577 | fp.Transparency=transparency | |
578 | fp.CanCollide=false | |
579 | fp.Locked=true | |
580 | fp.BrickColor=brickcolor | |
581 | fp.Name=name | |
582 | fp.Size=size | |
583 | NoOutline(fp) | |
584 | fp.Material="SmoothPlastic" | |
585 | fp:BreakJoints() | |
586 | return fp | |
587 | end | |
588 | ||
589 | function mesh(Mesh,part,meshtype,meshid,offset,scale) | |
590 | local mesh=it(Mesh) | |
591 | mesh.Parent=part | |
592 | if Mesh=="SpecialMesh" then | |
593 | mesh.MeshType=meshtype | |
594 | if meshid~="nil" then | |
595 | mesh.MeshId="http://www.roblox.com/asset/?id="..meshid | |
596 | end | |
597 | end | |
598 | mesh.Offset=offset | |
599 | mesh.Scale=scale | |
600 | return mesh | |
601 | end | |
602 | ||
603 | function weld(parent,part0,part1,c0) | |
604 | local weld=it("Motor") | |
605 | weld.Parent=parent | |
606 | weld.Part0=part0 | |
607 | weld.Part1=part1 | |
608 | weld.C0=c0 | |
609 | return weld | |
610 | end | |
611 | ||
612 | function gui(GuiType,parent,text,backtrans,backcol,pos,size,image) | |
613 | local gui=it(GuiType) | |
614 | gui.Parent=parent | |
615 | gui.BackgroundTransparency=backtrans | |
616 | gui.BackgroundColor3=backcol | |
617 | gui.SizeConstraint="RelativeXY" | |
618 | gui.Position=pos | |
619 | gui.Size=size | |
620 | if GuiType=="TextLabel" then | |
621 | gui.Text=text | |
622 | gui.TextXAlignment="Center" | |
623 | gui.TextYAlignment="Center" | |
624 | gui.Font="SourceSans" | |
625 | gui.FontSize="Size14" | |
626 | gui.TextWrapped=false | |
627 | gui.TextStrokeTransparency=0 | |
628 | gui.TextColor=BrickColor.new("Really black") | |
629 | elseif GuiType=="ImageLabel" then | |
630 | gui.Image="rbxassetid://"..image | |
631 | gui.ImageColor3=backcol | |
632 | end | |
633 | return gui | |
634 | end | |
635 | ||
636 | local Characte=Instance.new("Model") | |
637 | Characte.Parent=Character | |
638 | Characte.Name=bName | |
639 | ||
640 | ||
641 | --local Torso=part(0,Character,0,0,MainColor,"Torso",vt(2,2,1)) | |
642 | local Torsoc=part(0,Character,0,0,SubColor,"Torso Copy",vt(2,2,1)) | |
643 | --local LeftArm=part(0,Character,0,0,MainColor,"Left Arm",vt(1,2,1)) | |
644 | local LeftArmc=part(0,Character,0,0,SubColor,"Left Arm Copy",vt(1,2,1)) | |
645 | --local RightArm=part(0,Character,0,0,MainColor,"Right Arm",vt(1,2,1)) | |
646 | local RightArmc=part(0,Character,0,0,SubColor,"Right Arm Copy",vt(1,2,1)) | |
647 | --local LeftLeg=part(0,Character,0,0,MainColor,"Left Leg",vt(1,2,1)) | |
648 | local LeftLegc=part(0,Character,0,0,SubColor,"Left Leg Copy",vt(1,2,1)) | |
649 | --local RightLeg=part(0,Character,0,0,MainColor,"Right Leg",vt(1,2,1)) | |
650 | local RightLegc=part(0,Character,0,0,SubColor,"Right Leg Copy",vt(1,2,1)) | |
651 | ||
652 | ||
653 | --local Head=part(0,Character,0,0,BrickColor.new("Pastel brown"),"Head",vt(2,1,1)) | |
654 | --[[local Torso=part(0,Character,0,0,MainColor,"Torso",vt(2,2,1)) | |
655 | local Torsoc=part(0,Character,0,0,SubColor,"Torso Copy",vt(2,2,1)) | |
656 | local LeftArm=part(0,Character,0,0,SubColor,"Left Arm",vt(1,2,1)) | |
657 | local LeftArmc=part(0,Character,0,0,MainColor,"Left Arm Copy",vt(1,2,1)) | |
658 | local RightArm=part(0,Character,0,0,SubColor,"Right Arm",vt(1,2,1)) | |
659 | local RightArmc=part(0,Character,0,0,MainColor,"Right Arm Copy",vt(1,2,1)) | |
660 | local LeftLeg=part(0,Character,0,0,SubColor,"Left Leg",vt(1,2,1)) | |
661 | local LeftLegc=part(0,Character,0,0,MainColor,"Left Leg Copy",vt(1,2,1)) | |
662 | local RightLeg=part(0,Character,0,0,SubColor,"Right Leg",vt(1,2,1)) | |
663 | local RightLegc=part(0,Character,0,0,MainColor,"Right Leg Copy",vt(1,2,1))]] | |
664 | --local RootPart=part(0,Character,0,1,MainColor,"HumanoidRootPart",vt(2,2,1)) | |
665 | local Cape=part(0,Character,0,0,BrickColor.new("Really black"),"Hat",vt()) | |
666 | Head.CanCollide=true | |
667 | Torso.CanCollide=true | |
668 | LeftArm.CanCollide=true | |
669 | RightArm.CanCollide=true | |
670 | LeftLeg.CanCollide=true | |
671 | RightLeg.CanCollide=true | |
672 | RootPart.CanCollide=false | |
673 | Head.face:Remove() | |
674 | face=Instance.new("Decal",Head) | |
675 | face.Face="Front" | |
676 | --face.Texture="http://www.roblox.com/asset/?id=" | |
677 | face.Texture="http://www.roblox.com/asset/?id=" | |
678 | ||
679 | local HMesh=mesh("SpecialMesh",Head,"Head","nil",vt(0,0,0),vt(1.25,1.25,1.25)) | |
680 | local TMsh=mesh("SpecialMesh",Torso,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(1.8,1,.8)) | |
681 | local LAMsh=mesh("SpecialMesh",LeftArm,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,.8,.8)) | |
682 | local RAMsh=mesh("SpecialMesh",RightArm,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,.8,.8)) | |
683 | local LLMsh=mesh("SpecialMesh",LeftLeg,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,1,.8)) | |
684 | local RLMsh=mesh("SpecialMesh",RightLeg,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(.8,1,.8)) | |
685 | local TcMsh=mesh("SpecialMesh",Torsoc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-2,-1,-1)) | |
686 | local LAcMsh=mesh("SpecialMesh",LeftArmc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1,-1)) | |
687 | local RAcMsh=mesh("SpecialMesh",RightArmc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1,-1)) | |
688 | local LLcMsh=mesh("SpecialMesh",LeftLegc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1.2,-1)) | |
689 | local RLcMsh=mesh("SpecialMesh",RightLegc,"FileMesh","rbxasset://fonts/leftarm.mesh",vt(0,0,0),vt(-1,-1.2,-1)) | |
690 | TMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
691 | LAMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
692 | RAMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
693 | LLMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
694 | RLMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
695 | TcMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
696 | LAcMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
697 | RAcMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
698 | LLcMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
699 | RLcMsh.MeshId="rbxasset://fonts/leftarm.mesh" | |
700 | local Cmsh=mesh("SpecialMesh",Cape,"FileMesh","http://www.roblox.com/asset/?id=250281794",vt(0,0,0),vt(1,1,1)) | |
701 | ||
702 | --[[local Neck=weld(Torso,Torso,Head,cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)) | |
703 | Neck.C1=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)]] | |
704 | local Neck=weld(Torso,Torso,Head,euler(0,0,0)*cf(0,1,0)) | |
705 | Neck.C1=cf(0,-.5,0) | |
706 | local RW=weld(Torso,Torso,RightArm,cf(1.5,.5,0)) | |
707 | RW.C1=cf(0,.5,0) | |
708 | local RWc=weld(Torso,RightArm,RightArmc,cf(0,0,0)) | |
709 | local LW=weld(Torso,Torso,LeftArm,cf(-1.5,.5,0)) | |
710 | LW.C1=cf(0,.5,0) | |
711 | local LWc=weld(Torso,LeftArm,LeftArmc,cf(0,0,0)) | |
712 | local RH=weld(Torso,Torso,RightLeg,cf(.5,-1,0)) | |
713 | RH.C1=cf(0,1,0) | |
714 | local RHc=weld(Torso,RightLeg,RightLegc,cf(0,0,0)) | |
715 | local LH=weld(Torso,Torso,LeftLeg,cf(-.5,-1,0)) | |
716 | LH.C1=cf(0,1,0) | |
717 | local LHc=weld(Torso,LeftLeg,LeftLegc,cf(0,0,0)) | |
718 | local RootJoint=weld(Torso,Torso,RootPart,cf(0,0,0)) | |
719 | local RootJointc=weld(Torso,Torso,Torsoc,cf(0,0,0)) | |
720 | --local Cwld=weld(Torso,Cape,Head,euler(0,0,0)*cf(0,2,-.3)) | |
721 | local Cwld=weld(Torso,Cape,Torso,euler(0,0,0)*cf(0,.5,-.3)) | |
722 | --Torso.CFrame=cf(math.random(-5000,5000)/100,math.random(-5000,5000)/100,math.random(-5000,5000)/100) | |
723 | --Torso.CFrame=cf(0,0,0) | |
724 | --Torso.CFrame=workspace.Map.BossSpawn.CFrame*cf(0,5,0) | |
725 | ||
726 | local hitbox=part(3,nil,0,1,BrickColor.new("Really black"),"Hitbox",vt(1,1,1)) | |
727 | --hitbox.Anchored=true | |
728 | local hitbox2=part(3,nil,0,1,BrickColor.new("Really black"),"Hitbox",vt(1,1,1)) | |
729 | hitbox2.Anchored=true | |
730 | local hitboxCF=cf(0,0,0) | |
731 | ||
732 | ||
733 | ||
734 | --[[local Humanoid=Instance.new("Humanoid") | |
735 | Humanoid.Parent=Character | |
736 | TehHealth=700 | |
737 | --TehHealth=2000 | |
738 | Humanoid.MaxHealth=TehHealth | |
739 | Humanoid.Health=TehHealth | |
740 | coroutine.resume(coroutine.create(function() | |
741 | for i=1,20 do | |
742 | wait() | |
743 | Humanoid.Health=Humanoid.MaxHealth | |
744 | end | |
745 | Humanoid:TakeDamage(1) | |
746 | end))]] | |
747 | local Stats=Instance.new("BoolValue") | |
748 | Stats.Name="Stats" | |
749 | Stats.Parent=Character | |
750 | local Atk=Instance.new("NumberValue") | |
751 | Atk.Name="Damage" | |
752 | Atk.Parent=Stats | |
753 | Atk.Value=1 | |
754 | local Def=Instance.new("NumberValue") | |
755 | Def.Name="Defense" | |
756 | Def.Parent=Stats | |
757 | Def.Value=1 | |
758 | local Mvmt=Instance.new("NumberValue") | |
759 | Mvmt.Name="Movement" | |
760 | Mvmt.Parent=Stats | |
761 | Mvmt.Value=1 | |
762 | local Block=Instance.new("BoolValue") | |
763 | Block.Name="Block" | |
764 | Block.Parent=Stats | |
765 | Block.Value=false | |
766 | local Stun=Instance.new("NumberValue") | |
767 | Stun.Name="Stun" | |
768 | Stun.Parent=Stats | |
769 | Stun.Value=0 | |
770 | local StunT=Instance.new("NumberValue") | |
771 | StunT.Name="StunThreshold" | |
772 | StunT.Parent=Stats | |
773 | StunT.Value=100 | |
774 | local Rooted=Instance.new("BoolValue") | |
775 | Rooted.Name="Rooted" | |
776 | Rooted.Parent=Stats | |
777 | Rooted.Value=false | |
778 | local Stunned=Instance.new("BoolValue") | |
779 | Stunned.Name="Stunned" | |
780 | Stunned.Parent=Stats | |
781 | Stunned.Value=false | |
782 | local Stagger=Instance.new("BoolValue") | |
783 | Stagger.Name="Stagger" | |
784 | Stagger.Parent=Stats | |
785 | Stagger.Value=false | |
786 | local StaggerHit=Instance.new("BoolValue") | |
787 | StaggerHit.Name="StaggerHit" | |
788 | StaggerHit.Parent=Stats | |
789 | StaggerHit.Value=false | |
790 | local RecentEnemy=Instance.new("ObjectValue") | |
791 | RecentEnemy.Name="RecentEnemy" | |
792 | RecentEnemy.Parent=Stats | |
793 | RecentEnemy.Value=nil | |
794 | local Decrease=Instance.new("BoolValue") | |
795 | Decrease.Name="Decrease" | |
796 | Decrease.Parent=Stats | |
797 | Decrease.Value=false | |
798 | local mana=Instance.new("NumberValue") | |
799 | mana.Name="Mana" | |
800 | mana.Parent=Stats | |
801 | mana.Value=0 | |
802 | local boss=Instance.new("BoolValue") | |
803 | boss.Name="Boss" | |
804 | boss.Parent=Stats | |
805 | boss.Value=true | |
806 | local alive=Instance.new("BoolValue") | |
807 | alive.Name="Alive" | |
808 | alive.Parent=Character | |
809 | alive.Value=true | |
810 | local btarget=Instance.new("ObjectValue") | |
811 | btarget.Name="Target" | |
812 | btarget.Parent=Stats | |
813 | btarget.Value=nil | |
814 | local passive1=Instance.new("NumberValue",Decrease) | |
815 | passive1.Name="DecreaseAtk" | |
816 | passive1.Value=-.4 | |
817 | local passive2=Instance.new("NumberValue",Decrease) | |
818 | passive2.Name="DecreaseDef" | |
819 | passive2.Value=-.1 | |
820 | local passive3=Instance.new("NumberValue",Decrease) | |
821 | passive3.Name="DecreaseMvmt" | |
822 | passive3.Value=.1 | |
823 | ||
824 | so = function(id,par,vol,pit) | |
825 | local sou = Instance.new("Sound",par or workspace) | |
826 | sou.Volume=1.5 | |
827 | sou.Pitch=pit or 1 | |
828 | sou.SoundId="http://www.roblox.com/asset/?id="..id | |
829 | --swait() | |
830 | sou:play() | |
831 | game:GetService("Debris"):AddItem(sou,6) | |
832 | end | |
833 | ||
834 | local function CFrameFromTopBack(at, top, back) | |
835 | local right = top:Cross(back) | |
836 | return CFrame.new(at.x, at.y, at.z, | |
837 | right.x, top.x, back.x, | |
838 | right.y, top.y, back.y, | |
839 | right.z, top.z, back.z) | |
840 | end | |
841 | ||
842 | function Triangle(a, b, c) | |
843 | local edg1 = (c-a):Dot((b-a).unit) | |
844 | local edg2 = (a-b):Dot((c-b).unit) | |
845 | local edg3 = (b-c):Dot((a-c).unit) | |
846 | if edg1 <= (b-a).magnitude and edg1 >= 0 then | |
847 | a, b, c = a, b, c | |
848 | elseif edg2 <= (c-b).magnitude and edg2 >= 0 then | |
849 | a, b, c = b, c, a | |
850 | elseif edg3 <= (a-c).magnitude and edg3 >= 0 then | |
851 | a, b, c = c, a, b | |
852 | else | |
853 | assert(false, "unreachable") | |
854 | end | |
855 | ||
856 | local len1 = (c-a):Dot((b-a).unit) | |
857 | local len2 = (b-a).magnitude - len1 | |
858 | local width = (a + (b-a).unit*len1 - c).magnitude | |
859 | ||
860 | local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit) | |
861 | ||
862 | local list = {} | |
863 | ||
864 | if len1 > 0.01 then | |
865 | local w1 = Instance.new('WedgePart', m) | |
866 | w1.Name = "Triangle" | |
867 | game:GetService("Debris"):AddItem(w1,5) | |
868 | w1.Material = "SmoothPlastic" | |
869 | w1.FormFactor = 'Custom' | |
870 | w1.BrickColor = BrickColor.new("Teal") | |
871 | w1.Transparency = 0 | |
872 | w1.Reflectance = 0 | |
873 | w1.Material = "SmoothPlastic" | |
874 | w1.CanCollide = false | |
875 | NoOutline(w1) | |
876 | local sz = Vector3.new(0.2, width, len1) | |
877 | w1.Size = sz | |
878 | local sp = Instance.new("SpecialMesh",w1) | |
879 | sp.MeshType = "Wedge" | |
880 | sp.Scale = Vector3.new(0,1,1) * sz/w1.Size | |
881 | w1:BreakJoints() | |
882 | w1.Anchored = true | |
883 | w1.Parent = workspace | |
884 | w1.Transparency = 0.7 | |
885 | table.insert(Effects,{w1,"Disappear",.05}) | |
886 | w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2) | |
887 | table.insert(list,w1) | |
888 | end | |
889 | ||
890 | if len2 > 0.01 then | |
891 | local w2 = Instance.new('WedgePart', m) | |
892 | w2.Name = "Triangle" | |
893 | game:GetService("Debris"):AddItem(w2,5) | |
894 | w2.Material = "SmoothPlastic" | |
895 | w2.FormFactor = 'Custom' | |
896 | w2.BrickColor = BrickColor.new("Teal") | |
897 | w2.Transparency = 0 | |
898 | w2.Reflectance = 0 | |
899 | w2.Material = "SmoothPlastic" | |
900 | w2.CanCollide = false | |
901 | NoOutline(w2) | |
902 | local sz = Vector3.new(0.2, width, len2) | |
903 | w2.Size = sz | |
904 | local sp = Instance.new("SpecialMesh",w2) | |
905 | sp.MeshType = "Wedge" | |
906 | sp.Scale = Vector3.new(0,1,1) * sz/w2.Size | |
907 | w2:BreakJoints() | |
908 | w2.Anchored = true | |
909 | w2.Parent = workspace | |
910 | w2.Transparency = 0.7 | |
911 | table.insert(Effects,{w2,"Disappear",.05}) | |
912 | w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2) | |
913 | table.insert(list,w2) | |
914 | end | |
915 | return unpack(list) | |
916 | end | |
917 | ||
918 | function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type) | |
919 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
920 | prt.Anchored=true | |
921 | prt.CFrame=cframe | |
922 | msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
923 | game:GetService("Debris"):AddItem(prt,3) | |
924 | if Type==1 or Type==nil then | |
925 | table.insert(Effects,{prt,"Block1",delay,x3,y3,z3,msh}) | |
926 | elseif Type==2 then | |
927 | table.insert(Effects,{prt,"Block2",delay,x3,y3,z3,msh}) | |
928 | end | |
929 | end | |
930 | ||
931 | function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
932 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
933 | prt.Anchored=true | |
934 | prt.CFrame=cframe | |
935 | local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1)) | |
936 | game:GetService("Debris"):AddItem(prt,3) | |
937 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
938 | end | |
939 | ||
940 | function MagicCircle2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
941 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
942 | prt.Anchored=true | |
943 | prt.CFrame=cframe | |
944 | local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1)) | |
945 | game:GetService("Debris"):AddItem(prt,3) | |
946 | table.insert(Effects,{prt,"Cylinder2",delay,x3,y3,z3,msh}) | |
947 | end | |
948 | ||
949 | function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
950 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5)) | |
951 | prt.Anchored=true | |
952 | prt.CFrame=cframe*cf(x2,y2,z2) | |
953 | local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1)) | |
954 | game:GetService("Debris"):AddItem(prt,3) | |
955 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
956 | end | |
957 | ||
958 | function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
959 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
960 | prt.Anchored=true | |
961 | prt.CFrame=cframe | |
962 | local msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
963 | game:GetService("Debris"):AddItem(prt,3) | |
964 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
965 | end | |
966 | ||
967 | function MagicCylinder3(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
968 | local prt=part(3,Character,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
969 | prt.Anchored=true | |
970 | prt.CFrame=cframe | |
971 | local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1)) | |
972 | game:GetService("Debris"):AddItem(prt,3) | |
973 | table.insert(Effects,{prt,"Cylinder2",delay,x3,y3,z3,msh}) | |
974 | end | |
975 | ||
976 | function MagicHead(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
977 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
978 | prt.Anchored=true | |
979 | prt.CFrame=cframe | |
980 | local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1)) | |
981 | game:GetService("Debris"):AddItem(prt,3) | |
982 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
983 | end | |
984 | ||
985 | function ClangEffect(brickcolor,cframe,duration,decrease,size,power) | |
986 | local prt=part(3,workspace,0,1,brickcolor,"Effect",vt(.2,.2,.2)) | |
987 | prt.Anchored=true | |
988 | prt.CFrame=cframe | |
989 | local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(5,5,5)) | |
990 | game:GetService("Debris"):AddItem(prt,3) | |
991 | table.insert(Effects,{prt,"CylinderClang",duration,decrease,size,power,prt.CFrame,nil}) | |
992 | end | |
993 | ||
994 | function MagicWave(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
995 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(.2,.2,.2)) | |
996 | prt.Anchored=true | |
997 | prt.CFrame=cframe | |
998 | local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1)) | |
999 | game:GetService("Debris"):AddItem(prt,3) | |
1000 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
1001 | end | |
1002 | ||
1003 | --[[local BodGy=Instance.new("BodyGyro") | |
1004 | BodGy.maxTorque=Vector3.new(0,4e+005,0) | |
1005 | BodGy.P=2000 | |
1006 | BodGy.D=100 | |
1007 | BodGy.Name="SiegmundGyro" | |
1008 | CF=RootPart.CFrame | |
1009 | BodGy.Parent=RootPart | |
1010 | BodGy.cframe=CF]] | |
1011 | ||
1012 | --[[Neck.C0=euler(0,0,0)*cf(0,3,0)*euler(0,.6,0)*euler(-.2,0,0) | |
1013 | RootJoint.C0=cf(0,-2,0)*euler(0,.6,0) | |
1014 | RW.C0=cf(4.5,1.5,0)*euler(-.4,0,.5)*euler(0,0,0) | |
1015 | RW.C1=cf(0,1.5,0)*euler(0,0,0) | |
1016 | LW.C0=cf(-4.5,1.5,0)*euler(.2,0,-.5) | |
1017 | LW.C1=cf(0,1.5,0)*euler(0,0,0) | |
1018 | RH.C0=cf(1.5,-3,0)*euler(0,-.6,0)*euler(0,0,.1) | |
1019 | RH.C1=cf(0,3,0)*euler(0,0,0) | |
1020 | LH.C0=cf(-1.5,-3,0)*euler(0,.6,0)*euler(.1,0,0) | |
1021 | LH.C1=cf(0,3,0)*euler(0,0,0)]] | |
1022 | ||
1023 | --[[RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3,0,0.5),.3) | |
1024 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.3) | |
1025 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.4,0,0),.3) | |
1026 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-1)*euler(0,0,0),.3) | |
1027 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(-1.2,1.57,0),.3) | |
1028 | LH.C0=clerp(LH.C0,cf(-1.1,-.5,-0.5)*euler(-0.2,-1.3,0),.3)]] | |
1029 | function StartAnim() | |
1030 | attack=true | |
1031 | --workspace.CurrentCamera.CameraSubject=Head | |
1032 | Neck.C0=necko*euler(-1,0,0) | |
1033 | RootJoint.C0=cf(0,10,0)*euler(3.14,0,0) | |
1034 | RW.C0=cf(.8,.7,-.8)*euler(2,0,-1.4)*euler(0,0,0) | |
1035 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1036 | LW.C0=cf(-.8,0,-.8)*euler(1.4,0,1.4)*euler(0,0,0) | |
1037 | LW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1038 | RH.C0=cf(.5,-.4,-.4)*euler(0,1.57,0)*euler(-.1,0,-.2) | |
1039 | LH.C0=cf(-.5,-.4,-.4)*euler(0,-1.57,0)*euler(-.1,0,.2) | |
1040 | hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,10,Character) | |
1041 | while hitfloor==nil do | |
1042 | swait() | |
1043 | end | |
1044 | for i=0,1,0.05 do | |
1045 | swait() | |
1046 | Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.2) | |
1047 | RootJoint.C0=clerp(RootJoint.C0,cf(0,1,0)*euler(0,0,0),.2) | |
1048 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.2),.2) | |
1049 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.2) | |
1050 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(-1.2,1.57,0),.2) | |
1051 | LH.C0=clerp(LH.C0,cf(-.6,-.5,-0.5)*euler(-0.2,-1.3,0),.2) | |
1052 | end | |
1053 | --MagniDamage(Torso,15,6,8,math.random(20,40),"Knockdown2",Torso,0,1,math.random(8,10),nil,nil,true) | |
1054 | --[[for i=0,1,0.05 do | |
1055 | swait() | |
1056 | Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3) | |
1057 | RootJoint.C0=clerp(RootJoint.C0,cf(0,1,0)*euler(0,0,0),.3) | |
1058 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.2),.3) | |
1059 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.2),.3) | |
1060 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(-1.2,1.57,0),.3) | |
1061 | LH.C0=clerp(LH.C0,cf(-.6,-.5,-0.5)*euler(-0.2,-1.3,0),.3) | |
1062 | end]] | |
1063 | attack=false | |
1064 | end | |
1065 | --[[RW.C0=cf(1.5,0.5,0)*euler(0,0,1.2) | |
1066 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,-1.2) | |
1067 | Neck.C0=necko*euler(-.4,0,0) | |
1068 | RootJoint.C0=cf(0,1,0)*euler(0,0,0) | |
1069 | RH.C0=cf(1,-1,0)*euler(-1.2,1.57,0) | |
1070 | LH.C0=cf(-1.1,-.5,-0.5)*euler(-0.2,-1.3,0)]] | |
1071 | ||
1072 | local BodGy=Instance.new("BodyGyro") | |
1073 | BodGy.maxTorque=Vector3.new(0,0,0) | |
1074 | BodGy.P=0 | |
1075 | BodGy.D=0 | |
1076 | BodGy.Name="SJamesGyro" | |
1077 | CF=RootPart.CFrame | |
1078 | BodGy.Parent=RootPart | |
1079 | BodGy.cframe=CF | |
1080 | ||
1081 | wait() | |
1082 | print("Stick James spawned.") | |
1083 | ||
1084 | function StunAnim() | |
1085 | attack=true | |
1086 | Stunned.Value=true | |
1087 | showDamage(Character,"Stunned","Interrupt") | |
1088 | local dec=Instance.new("NumberValue",Decrease) | |
1089 | dec.Name="DecreaseMvmt" | |
1090 | dec.Value=10 | |
1091 | for i=0,1,0.3 do | |
1092 | swait() | |
1093 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,.5,0),.2) | |
1094 | RootJoint.C0=clerp(RootJoint.C0,euler(-.2,3,0),.2) | |
1095 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,1.3),.2) | |
1096 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1097 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.4)*euler(0,-.1,0),.2) | |
1098 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1099 | RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.3),.25) | |
1100 | LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(-.2,0,0),.25) | |
1101 | end | |
1102 | for i=0,1,0.3 do | |
1103 | swait() | |
1104 | Neck.C0=clerp(Neck.C0,necko*euler(-.3,.5,0),.2) | |
1105 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-.5)*euler(-.8,3,0),.2) | |
1106 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2) | |
1107 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1108 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1.2,0,.8)*euler(0,-.1,0),.2) | |
1109 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1110 | RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.6),.25) | |
1111 | LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(.1,0,.7),.25) | |
1112 | end | |
1113 | for i=0,1,0.3 do | |
1114 | swait() | |
1115 | Neck.C0=clerp(Neck.C0,necko*euler(-.3,-1,0),.2) | |
1116 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2)*euler(-1.57,3,0),.2) | |
1117 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2) | |
1118 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1119 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,-.8)*euler(0,-.1,0),.2) | |
1120 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1121 | RH.C0=clerp(RH.C0,cf(.5,-.6,0)*euler(0,1.57,0)*euler(-.2,0,.6),.25) | |
1122 | LH.C0=clerp(LH.C0,cf(-.5,-.8,0)*euler(0,-1.57,0)*euler(-.1,0,.3),.25) | |
1123 | end | |
1124 | local gairost=Instance.new("BodyGyro") | |
1125 | gairost.Parent=RootPart | |
1126 | gairost.maxTorque=Vector3.new(2000,0,2000) | |
1127 | gairost.P=2000 | |
1128 | gairost.cframe=cf(0,0,0) | |
1129 | for i=0,1,0.1 do | |
1130 | swait() | |
1131 | Neck.C0=clerp(Neck.C0,necko*euler(0,-1.57,0),.3) | |
1132 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2.5)*euler(-1.57,3.14,0),.3) | |
1133 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1.5)*euler(.2,0,0),.3) | |
1134 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1135 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.5,0,-1.57)*euler(0,0,0),.3) | |
1136 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1137 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.3,.5,0),.3) | |
1138 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(-.1,.2,0),.3) | |
1139 | end | |
1140 | for i=1,300 do | |
1141 | swait() | |
1142 | gairost.cframe=RootPart.CFrame | |
1143 | end | |
1144 | for i=0,1,0.2 do | |
1145 | swait() | |
1146 | Stun.Value=0 | |
1147 | gairost.cframe=RootPart.CFrame | |
1148 | Neck.C0=clerp(Neck.C0,necko*euler(0,.2,0),.3) | |
1149 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,-2)*euler(-1,4,0),.3) | |
1150 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1)*euler(.2,-1,0),.3) | |
1151 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1152 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,.2)*euler(0,0,0),.3) | |
1153 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1154 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.3,.5,.4),.3) | |
1155 | LH.C0=clerp(LH.C0,cf(-.5,-1,-1)*euler(0,-1.57,0)*euler(-.1,.2,1),.3) | |
1156 | end | |
1157 | gairost.Parent=nil | |
1158 | dec.Parent=nil | |
1159 | Stun.Value=0 | |
1160 | Stunned.Value=false | |
1161 | attack=false | |
1162 | for i=1,10 do | |
1163 | swait() | |
1164 | Stun.Value=0 | |
1165 | end | |
1166 | end | |
1167 | function HeavyPunch(movement) | |
1168 | attack=true | |
1169 | for i=0,1,0.1 do | |
1170 | swait() | |
1171 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.3) | |
1172 | RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,0,0),.3) | |
1173 | RW.C0=clerp(RW.C0,cf(.8,1.2,-.8)*euler(2,0,-1.4)*euler(0,0,0),.3) | |
1174 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1175 | LW.C0=clerp(LW.C0,cf(-.8,.4,-.8)*euler(1.4,0,1.4)*euler(0,0,0),.3) | |
1176 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1177 | RH.C0=clerp(RH.C0,cf(.5,-1,-.2)*euler(0,1.57,0)*euler(-.1,-.2,0),.3) | |
1178 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(-.1,.2,0),.3) | |
1179 | end | |
1180 | for i=0,1,0.1 do | |
1181 | swait() | |
1182 | Neck.C0=clerp(Neck.C0,necko*euler(0,1,0)*euler(0,0,0),.3) | |
1183 | RootJoint.C0=clerp(RootJoint.C0,euler(0,1,0)*cf(0,0,0),.3) | |
1184 | RW.C0=clerp(RW.C0,cf(1.5,.5,0)*euler(1.8,0,.5)*euler(0,0,0),.3) | |
1185 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1186 | LW.C0=clerp(LW.C0,cf(-1,.5,-.5)*euler(1,0,1.2)*euler(0,0,0),.3) | |
1187 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1188 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.4,-.2,0),.3) | |
1189 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,1,0)*euler(0,0,-.1),.3) | |
1190 | end | |
1191 | if movement==true then | |
1192 | Torso.Velocity=RootPart.CFrame.lookVector*150 | |
1193 | else | |
1194 | Torso.Velocity=RootPart.CFrame.lookVector*40 | |
1195 | end | |
1196 | so("169445092",RightArm,1,1) | |
1197 | for i=0,1,0.15 do | |
1198 | swait() | |
1199 | if RecentEnemy.Value==nil then | |
1200 | MagniDamage(RightArm,4,8,10,math.random(20,30),"Normal",RootPart,.2,2,10,nil,nil,false,nil,nil,nil,true) | |
1201 | end | |
1202 | Neck.C0=clerp(Neck.C0,necko*euler(0,-1,0)*euler(.2,0,0),.3) | |
1203 | RootJoint.C0=clerp(RootJoint.C0,euler(0,-1,0)*euler(.5,0,0)*cf(0,0,1),.3) | |
1204 | RW.C0=clerp(RW.C0,cf(1.5,.5,0)*euler(1.8,0,.5)*euler(0,0,0),.3) | |
1205 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1206 | LW.C0=clerp(LW.C0,cf(-1.5,.5,0)*euler(.5,0,-1.2)*euler(0,0,0),.3) | |
1207 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1208 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.2,-.4,0)*euler(0,0,-1),.3) | |
1209 | LH.C0=clerp(LH.C0,cf(-.3,-.9,-.6)*euler(0,-1.57,0)*euler(0,-1,0)*euler(0,0,-.7),.3) | |
1210 | end | |
1211 | for i=0,1,0.1 do | |
1212 | swait() | |
1213 | Neck.C0=clerp(Neck.C0,necko*euler(0,-1,0)*euler(.2,0,0),.3) | |
1214 | RootJoint.C0=clerp(RootJoint.C0,euler(0,-1.2,0)*euler(.3,0,0)*cf(0,0,.5),.3) | |
1215 | RW.C0=clerp(RW.C0,cf(1.5,.5,0)*euler(1,0,.2)*euler(0,0,0),.3) | |
1216 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1217 | LW.C0=clerp(LW.C0,cf(-1.5,.5,0)*euler(.2,0,-.5)*euler(0,0,0),.3) | |
1218 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1219 | RH.C0=clerp(RH.C0,cf(.5,-.9,-.5)*euler(0,1.57,0)*euler(-.2,-.4,0)*euler(0,0,-1.2),.3) | |
1220 | LH.C0=clerp(LH.C0,cf(-.3,-.9,-.6)*euler(0,-1.57,0)*euler(0,-1,0)*euler(0,0,-.5),.3) | |
1221 | end | |
1222 | attack=false | |
1223 | end | |
1224 | ||
1225 | function Punch(movement) | |
1226 | attack=true | |
1227 | for i=0,1,0.1 do | |
1228 | swait() | |
1229 | Neck.C0=clerp(Neck.C0,necko*euler(0,-.5,0)*euler(-.2,0,0),.3) | |
1230 | RootJoint.C0=clerp(RootJoint.C0,euler(0,-.5,0)*euler(.1,0,0)*cf(0,.2,0),.3) | |
1231 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(.2,0,.8)*euler(0,0,0),.3) | |
1232 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1233 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.4,0,.5)*euler(0,0,0),.3) | |
1234 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1235 | RH.C0=clerp(RH.C0,cf(.6,-.9,-.2)*euler(0,1.57,0)*euler(0,-.5,-.05),.3) | |
1236 | LH.C0=clerp(LH.C0,cf(-.6,-.8,-.2)*euler(0,-1.57,0)*euler(0,0,.4),.3) | |
1237 | end | |
1238 | if movement==true then | |
1239 | Torso.Velocity=RootPart.CFrame.lookVector*150 | |
1240 | else | |
1241 | Torso.Velocity=RootPart.CFrame.lookVector*40 | |
1242 | end | |
1243 | so("169445092",LeftArm,1,1.2) | |
1244 | for i=0,1,0.1 do | |
1245 | swait() | |
1246 | MagniDamage(LeftArm,4,6,8,math.random(15,20),"Normal",RootPart,.2,2,math.random(5,7),nil,nil,false,nil,nil,nil,false) | |
1247 | --MagniDamage(LeftArm,2,6,8,0,"Normal",RootPart,.3,1,math.random(6,7),nil,nil) | |
1248 | Neck.C0=clerp(Neck.C0,necko*euler(0,1,0)*euler(-.1,0,0),.3) | |
1249 | RootJoint.C0=clerp(RootJoint.C0,euler(0,1,0)*euler(.2,0,0)*cf(0,.2,1),.3) | |
1250 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,1)*euler(0,0,0),.3) | |
1251 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1252 | --LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.7,0,.2)*euler(0,0,0),.3) | |
1253 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
1254 | RH.C0=clerp(RH.C0,cf(.6,-.9,-.2)*euler(0,1.57,0)*euler(0,.8,-.3),.3) | |
1255 | LH.C0=clerp(LH.C0,cf(-.6,-.9,-.2)*euler(0,-1.57,0)*euler(0,1,0),.3) | |
1256 | if i<.3 then | |
1257 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.7,0,-.6)*euler(0,0,0),.3) | |
1258 | else | |
1259 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.2)*euler(1.7,0,-.3)*euler(0,0,0),.3) | |
1260 | end | |
1261 | end | |
1262 | attack=false | |
1263 | end | |
1264 | ||
1265 | function ButtonPunch(movement) | |
1266 | attack=true | |
1267 | buttonp=true | |
1268 | for i=0,1,0.1 do | |
1269 | swait() | |
1270 | Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3) | |
1271 | RootJoint.C0=clerp(RootJoint.C0,cf(0,1,0)*euler(0,0,0),.3) | |
1272 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,.5),.3) | |
1273 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-.5),.3) | |
1274 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(-1.2,1.57,0),.3) | |
1275 | LH.C0=clerp(LH.C0,cf(-.6,-.5,-0.5)*euler(-0.2,-1.3,0),.3) | |
1276 | end | |
1277 | so("158149887",Torso,.5,.8) | |
1278 | if movement==true then | |
1279 | Torso.Velocity=RootPart.CFrame.lookVector*150 | |
1280 | else | |
1281 | Torso.Velocity=RootPart.CFrame.lookVector*40 | |
1282 | end | |
1283 | cef=0 | |
1284 | cef2=0 | |
1285 | for i=0,1,0.1 do | |
1286 | swait() | |
1287 | Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3) | |
1288 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,0)*euler(0,0,0),.3) | |
1289 | RootJoint.C1=cf(0,cef2,0)*euler(cef,0,0) | |
1290 | cef=cef+.6 | |
1291 | cef2=cef2+.5 | |
1292 | RW.C0=cf(.8,.7,-.8)*euler(2,0,-1.4)*euler(0,0,0) | |
1293 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1294 | LW.C0=cf(-.8,0,-.8)*euler(1.4,0,1.4)*euler(0,0,0) | |
1295 | LW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1296 | RH.C0=clerp(RH.C0,cf(.5,-.4,-.4)*euler(0,1.57,0)*euler(-.1,0,-.2),.3) | |
1297 | LH.C0=clerp(LH.C0,cf(-.5,-.4,-.4)*euler(0,-1.57,0)*euler(-.1,0,.2),.3) | |
1298 | end | |
1299 | for i=0,1,0.1 do | |
1300 | swait() | |
1301 | Neck.C0=clerp(Neck.C0,necko*euler(-.6,0,0)*euler(0,-1,0),.3) | |
1302 | RootJoint.C0=clerp(RootJoint.C0,cf(0,0,0)*euler(0,-1,0),.3) | |
1303 | RootJoint.C1=clerp(RootJoint.C1,cf(0,5,0)*euler(.2,0,0),.3) | |
1304 | RW.C0=cf(1.5,.5,0)*euler(.5,0,.5)*euler(0,0,0) | |
1305 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1306 | LW.C0=cf(-1.5,.5,0)*euler(2,0,-1)*euler(0,0,0) | |
1307 | LW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1308 | RH.C0=clerp(RH.C0,cf(.5,-.8,-.1)*euler(0,1.57,0)*euler(-.1,0,-.4),.3) | |
1309 | LH.C0=clerp(LH.C0,cf(-.5,-.8,-.1)*euler(0,-1.57,0)*euler(-.1,0,.4),.3) | |
1310 | end | |
1311 | so("169445092",RightArm,1,1) | |
1312 | for i=0,1,0.05 do | |
1313 | swait() | |
1314 | if RecentEnemy.Value==nil then | |
1315 | MagniDamage(RightArm,5,10,12,math.random(20,30),"Normal",RootPart,.2,2,10,nil,nil,false,nil,nil,nil,true) | |
1316 | end | |
1317 | Neck.C0=clerp(Neck.C0,necko*euler(0,.7,0)*euler(-.1,0,0),.3) | |
1318 | RootJoint.C0=clerp(RootJoint.C0,euler(0,1,0)*euler(.3,0,0)*cf(0,0,1),.3) | |
1319 | RootJoint.C1=clerp(RootJoint.C1,cf(0,0,0)*euler(0,0,0),.3) | |
1320 | RW.C0=cf(1.5,.5,0)*euler(.5,0,.5)*euler(0,0,0) | |
1321 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1322 | LW.C0=cf(-1.5,.5,0)*euler(2,0,-.8)*euler(0,0,0) | |
1323 | LW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1324 | RH.C0=clerp(RH.C0,cf(.5,-.8,-.1)*euler(0,1.57,0)*euler(-.5,-1,0),.3) | |
1325 | LH.C0=clerp(LH.C0,cf(-.5,-.9,-.3)*euler(0,-1.57,0)*euler(-.1,-1,.1),.3) | |
1326 | end | |
1327 | RootJoint.C1=cf(0,0,0) | |
1328 | buttonp=false | |
1329 | attack=false | |
1330 | for i=1,500 do | |
1331 | swait() | |
1332 | if buttonp==true then break end | |
1333 | end | |
1334 | for _,c in pairs(workspace:children()) do | |
1335 | if c:findFirstChild("Stats")~=nil then | |
1336 | if c.Stats:findFirstChild("Boss")~=nil then | |
1337 | if c.Stats.Boss.Value==true then | |
1338 | if c.Stats:findFirstChild("Target")~=nil then | |
1339 | c.Stats.Target.Value=nil | |
1340 | end | |
1341 | end | |
1342 | end | |
1343 | end | |
1344 | end | |
1345 | end | |
1346 | ||
1347 | ||
1348 | function DecreaseStat(Model,Stat,Amount,Duration) | |
1349 | if Model:findFirstChild("Stats")~=nil then | |
1350 | if Model.Stats[Stat]~=nil then | |
1351 | Model.Stats[Stat].Value=Model.Stats[Stat].Value-Amount | |
1352 | d=Instance.new("NumberValue",Model.Stats.Decrease) | |
1353 | game:GetService("Debris"):AddItem(d,40) | |
1354 | if Stat=="Damage" then | |
1355 | d.Name="DecreaseAtk" | |
1356 | elseif Stat=="Defense" then | |
1357 | d.Name="DecreaseDef" | |
1358 | elseif Stat=="Movement" then | |
1359 | d.Name="DecreaseMvmt" | |
1360 | end | |
1361 | if Model:findFirstChild("Torso")~=nil then | |
1362 | display="" | |
1363 | if Stat=="Damage" then | |
1364 | if Amount>0 then | |
1365 | display="-Damage" | |
1366 | else | |
1367 | display="+Damage" | |
1368 | end | |
1369 | elseif Stat=="Defense" then | |
1370 | if Amount>0 then | |
1371 | display="-Defense" | |
1372 | else | |
1373 | display="+Defense" | |
1374 | end | |
1375 | elseif Stat=="Movement" then | |
1376 | if Amount>0 then | |
1377 | display="-Movement" | |
1378 | else | |
1379 | display="+Movement" | |
1380 | end | |
1381 | end | |
1382 | showDamage(Model,display,"Debuff") | |
1383 | end | |
1384 | d.Value=Amount | |
1385 | table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration,d}) | |
1386 | end | |
1387 | end | |
1388 | end | |
1389 | ||
1390 | function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants | |
1391 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
1392 | end | |
1393 | ||
1394 | --[[function findNearestTorso(pos) | |
1395 | local list = game.Workspace:children() | |
1396 | local torso = nil | |
1397 | local dist = 1000 | |
1398 | local temp = nil | |
1399 | local human = nil | |
1400 | local temp2 = nil | |
1401 | for x = 1, #list do | |
1402 | temp2 = list[x] | |
1403 | if (temp2.className == "Model") and (temp2.Name~=bName) then | |
1404 | temp = temp2:findFirstChild("Torso") | |
1405 | human = temp2:findFirstChild("Humanoid") | |
1406 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
1407 | if btarget.Value==nil then | |
1408 | if (temp.Position - pos).magnitude < dist then | |
1409 | local dohit=true | |
1410 | if temp2:findFirstChild("Stats")~=nil then if temp2.Stats:findFirstChild("Boss")~=nil then if temp2.Stats.Boss.Value==true then dohit=false end end end | |
1411 | if temp2:findFirstChild("Alive")==nil then dohit=false end | |
1412 | if dohit==true then | |
1413 | torso = temp | |
1414 | dist = (temp.Position - pos).magnitude | |
1415 | end | |
1416 | end | |
1417 | else | |
1418 | if btarget.Value.Parent~=nil then | |
1419 | if btarget.Value:findFirstChild("Torso")~=nil then | |
1420 | if btarget.Value:findFirstChild("Humanoid")~=nil then | |
1421 | if btarget.Value.Humanoid.Health<=0 then | |
1422 | btarget.Value=nil | |
1423 | end | |
1424 | end | |
1425 | if btarget.Value~=nil then | |
1426 | torso=btarget.Value.Torso | |
1427 | dist = (torso.Position - pos).magnitude | |
1428 | end | |
1429 | end | |
1430 | else | |
1431 | btarget.Value=nil | |
1432 | end | |
1433 | end | |
1434 | end | |
1435 | end | |
1436 | end | |
1437 | return torso,dist | |
1438 | end]] | |
1439 | findNearestTorso = function(pos) | |
1440 | local list = (game.Workspace:children()) | |
1441 | local torso = nil | |
1442 | local dist = 1000 | |
1443 | local temp, human, temp2 = nil, nil, nil | |
1444 | for x = 1, #list do | |
1445 | temp2 = list[x] | |
1446 | if temp2.className == "Model" and temp2.Name ~= Character.Name then | |
1447 | temp = temp2:findFirstChild("Torso") | |
1448 | human = temp2:findFirstChild("Humanoid") | |
1449 | if temp ~= nil and human ~= nil and human.Health > 0 and (temp.Position - pos).magnitude < dist then | |
1450 | local dohit = true | |
1451 | if dohit == true then | |
1452 | torso = temp | |
1453 | dist = (temp.Position - pos).magnitude | |
1454 | end | |
1455 | end | |
1456 | end | |
1457 | end | |
1458 | return torso, dist | |
1459 | end | |
1460 | function findRandomTorso(pos) | |
1461 | local list = game.Workspace:children() | |
1462 | local torso = nil | |
1463 | local dist = 1000 | |
1464 | local temp = nil | |
1465 | local human = nil | |
1466 | local temp2 = nil | |
1467 | local list2 = {} | |
1468 | for x = 1, #list do | |
1469 | temp2 = list[x] | |
1470 | if (temp2.className == "Model") and (temp2.Name~="Vanta") then | |
1471 | temp = temp2:findFirstChild("Torso") | |
1472 | human = temp2:findFirstChild("Humanoid") | |
1473 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
1474 | if pos.magnitude < dist then | |
1475 | torso = temp | |
1476 | table.insert(list2,temp) | |
1477 | end | |
1478 | end | |
1479 | end | |
1480 | end | |
1481 | if #list2>0 then | |
1482 | rand=math.random(1,#list2) | |
1483 | return list2[rand],dist | |
1484 | else | |
1485 | return nil,dist | |
1486 | end | |
1487 | end | |
1488 | ||
1489 | Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration,Sound) | |
1490 | if hit.Parent==nil then | |
1491 | return | |
1492 | end | |
1493 | h=hit.Parent:FindFirstChild("Humanoid") | |
1494 | for _,v in pairs(hit.Parent:children()) do | |
1495 | if v:IsA("Humanoid") then | |
1496 | h=v | |
1497 | end | |
1498 | end | |
1499 | if hit.Parent.Parent:FindFirstChild("Torso")~=nil then | |
1500 | h=hit.Parent.Parent:FindFirstChild("Humanoid") | |
1501 | end | |
1502 | if hit.Parent.className=="Hat" then | |
1503 | hit=hit.Parent.Parent:findFirstChild("Head") | |
1504 | end | |
1505 | if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then | |
1506 | if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end | |
1507 | if hit.Parent:findFirstChild("Stats")~=nil then if hit.Parent.Stats:findFirstChild("Boss")~=nil then if hit.Parent.Stats.Boss.Value==true then return end end end | |
1508 | RecentEnemy.Value=hit.Parent | |
1509 | game:GetService("Debris"):AddItem(c,.5) | |
1510 | minim=minim*Atk.Value | |
1511 | maxim=maxim*Atk.Value | |
1512 | Damage=0 | |
1513 | if minim==maxim or minim>maxim then | |
1514 | Damage=maxim | |
1515 | else | |
1516 | Damage=math.random(minim,maxim) | |
1517 | end | |
1518 | blocked=false | |
1519 | enblock=nil | |
1520 | Stats=hit.Parent:findFirstChild("Stats") | |
1521 | if Stats~=nil then | |
1522 | enblock=Stats:findFirstChild("Block") | |
1523 | if enblock~=nil then | |
1524 | if enblock.Value==true then | |
1525 | blocked=true | |
1526 | end | |
1527 | end | |
1528 | if Stats:findFirstChild("Defense")~=nil then | |
1529 | Damage=Damage/(Stats.Defense.Value) | |
1530 | if Damage<=3 and (ranged==false or ranged==nil) and blocked~=true then | |
1531 | hitnum=math.random(1,3) | |
1532 | if hitnum==1 then so("169380525",hit,1,math.random(80,120)/100) | |
1533 | elseif hitnum==2 then so("169380538",hit,1,math.random(80,120)/100) | |
1534 | elseif hitnum==3 then so("169380528",hit,1,math.random(80,120)/100) | |
1535 | end | |
1536 | --[[if hitnum==1 then so("199149321",hit,1,1) | |
1537 | elseif hitnum==2 then so("199149338",hit,1,1) | |
1538 | elseif hitnum==3 then so("199149367",hit,1,1) | |
1539 | elseif hitnum==4 then so("199149409",hit,1,1) | |
1540 | elseif hitnum==5 then so("199149452",hit,1,1) | |
1541 | end]] | |
1542 | elseif ranged==false or ranged==nil and blocked~=true then | |
1543 | hitnum=math.random(1,3) | |
1544 | if hitnum==1 then so("169380525",hit,1,math.random(80,120)/100) | |
1545 | elseif hitnum==2 then so("169380538",hit,1,math.random(80,120)/100) | |
1546 | elseif hitnum==3 then so("169380528",hit,1,math.random(80,120)/100) | |
1547 | end | |
1548 | --[[if hitnum==1 then so("199149137",hit,1,1) | |
1549 | elseif hitnum==2 then so("199149186",hit,1,1) | |
1550 | elseif hitnum==3 then so("199149221",hit,1,1) | |
1551 | elseif hitnum==4 then so("199149235",hit,1,1) | |
1552 | elseif hitnum==5 then so("199149269",hit,1,1) | |
1553 | elseif hitnum==6 then so("199149297",hit,1,1) | |
1554 | end]] | |
1555 | end | |
1556 | end | |
1557 | if Stats:findFirstChild("Stun")~=nil then | |
1558 | if blocked==true then | |
1559 | incstun=math.floor(incstun/2) | |
1560 | end | |
1561 | Stats.Stun.Value=Stats.Stun.Value+incstun | |
1562 | end | |
1563 | if Stats:findFirstChild("Stagger")~=nil then | |
1564 | if stagger==true then | |
1565 | Stats.Stagger.Value=true | |
1566 | end | |
1567 | end | |
1568 | end | |
1569 | if blocked==true then | |
1570 | showDamage(hit.Parent,"Block","Damage") | |
1571 | hitnum=math.random(1,2) | |
1572 | if hitnum==1 then so("199148933",hit,1,1) | |
1573 | elseif hitnum==2 then so("199148947",hit,1,1) | |
1574 | end | |
1575 | enblock.Value=false | |
1576 | else | |
1577 | Damage=math.floor(Damage) | |
1578 | h.Health=h.Health-Damage | |
1579 | --[[coroutine.resume(coroutine.create(function(Hum,Dam) | |
1580 | damageFunc:InvokeServer(Hum,Dam) | |
1581 | end),h,Damage)]] | |
1582 | showDamage(hit.Parent,Damage,"Damage") | |
1583 | if DecreaseState~=nil then | |
1584 | if DecreaseState=="Shatter" then | |
1585 | DecreaseStat(hit.Parent,"Movement",DecreaseAmount,Duration) | |
1586 | DecreaseStat(hit.Parent,"Damage",DecreaseAmount,Duration) | |
1587 | else | |
1588 | DecreaseStat(hit.Parent,DecreaseState,DecreaseAmount,Duration) | |
1589 | end | |
1590 | end | |
1591 | if Type=="Knockdown" then | |
1592 | hum=hit.Parent.Humanoid | |
1593 | hum.PlatformStand=true | |
1594 | coroutine.resume(coroutine.create(function(HHumanoid) | |
1595 | swait(1) | |
1596 | HHumanoid.PlatformStand=false | |
1597 | end),hum) | |
1598 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
1599 | --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0) | |
1600 | local bodvol=Instance.new("BodyVelocity") | |
1601 | bodvol.velocity=angle*knockback | |
1602 | bodvol.P=5000 | |
1603 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1604 | bodvol.Parent=hit | |
1605 | rl=Instance.new("BodyAngularVelocity") | |
1606 | rl.P=3000 | |
1607 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
1608 | rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)) | |
1609 | rl.Parent=hit | |
1610 | game:GetService("Debris"):AddItem(bodvol,.5) | |
1611 | game:GetService("Debris"):AddItem(rl,.5) | |
1612 | elseif Type=="Shatter" then | |
1613 | for i=1,10 do | |
1614 | BreakEffect(BrickColor.new("Cyan"),hit.CFrame,math.random(20,80)/100,math.random(2,10),math.random(20,80)/100) | |
1615 | end | |
1616 | elseif Type=="Knockdown2" then | |
1617 | hum=hit.Parent.Humanoid | |
1618 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
1619 | local bodvol=Instance.new("BodyVelocity") | |
1620 | bodvol.velocity=angle*knockback | |
1621 | bodvol.P=5000 | |
1622 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1623 | bodvol.Parent=hit | |
1624 | game:GetService("Debris"):AddItem(bodvol,.5) | |
1625 | elseif Type=="Normal" then | |
1626 | vp=Instance.new("BodyVelocity") | |
1627 | vp.P=500 | |
1628 | vp.maxForce=Vector3.new(math.huge,0,math.huge) | |
1629 | if KnockbackType==1 then | |
1630 | vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05 | |
1631 | elseif KnockbackType==2 then | |
1632 | vp.velocity=Property.CFrame.lookVector*knockback | |
1633 | end | |
1634 | game:GetService("Debris"):AddItem(vp,.5) | |
1635 | if knockback>0 then | |
1636 | vp.Parent=hit.Parent.Torso | |
1637 | end | |
1638 | end | |
1639 | end | |
1640 | debounce=Instance.new("BoolValue") | |
1641 | debounce.Name="DebounceHit" | |
1642 | debounce.Parent=hit.Parent | |
1643 | debounce.Value=true | |
1644 | game:GetService("Debris"):AddItem(debounce,Delay) | |
1645 | CRIT=false | |
1646 | end | |
1647 | end | |
1648 | ||
1649 | showDamage=function(Char,Dealt,Type) | |
1650 | m=Instance.new("Model") | |
1651 | m.Name="Effect" | |
1652 | c=Instance.new("Part") | |
1653 | c.Transparency=1 | |
1654 | c.Name="Head" | |
1655 | c.TopSurface=0 | |
1656 | c.BottomSurface=0 | |
1657 | c.formFactor="Plate" | |
1658 | c.Size=Vector3.new(1,.4,1) | |
1659 | b=Instance.new("BillboardGui",c) | |
1660 | b.Size=UDim2.new(5,0,5,0) | |
1661 | b.AlwaysOnTop=true | |
1662 | damgui=gui("TextLabel",b,tostring(Dealt),1,Color3.new(0,0,0),UDim2.new(0,0,0,0),UDim2.new(1,0,1,0)) | |
1663 | if Type=="Damage" then | |
1664 | damgui.Font="SourceSans" | |
1665 | if Dealt=="Block" then | |
1666 | damgui.TextColor3=BrickColor.new("Really black").Color | |
1667 | elseif Dealt<3 then | |
1668 | damgui.TextColor3=BrickColor.new("Really black").Color | |
1669 | elseif Dealt>=3 and Dealt<20 then | |
1670 | damgui.TextColor3=BrickColor.new("Black").Color | |
1671 | else | |
1672 | damgui.TextColor3=BrickColor.new("Really black").Color | |
1673 | damgui.Font="SourceSansBold" | |
1674 | end | |
1675 | elseif Type=="Debuff" then | |
1676 | damgui.TextColor3=BrickColor.new("Really black").Color | |
1677 | elseif Type=="Interrupt" then | |
1678 | damgui.TextColor3=BrickColor.new("Black").Color | |
1679 | end | |
1680 | --damgui.FontSize="Size48" | |
1681 | damgui.TextScaled=true | |
1682 | ms=Instance.new("CylinderMesh") | |
1683 | ms.Scale=Vector3.new(1,1,1) | |
1684 | ms.Parent=c | |
1685 | c.Reflectance=0 | |
1686 | Instance.new("BodyGyro").Parent=c | |
1687 | c.Parent=m | |
1688 | if Char:findFirstChild("Head")~=nil then | |
1689 | c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(math.random(-100,100)/100,3,math.random(-100,100)/100)) | |
1690 | elseif Char.Parent:findFirstChild("Head")~=nil then | |
1691 | c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(math.random(-100,100)/100,3,math.random(-100,100)/100)) | |
1692 | end | |
1693 | f=Instance.new("BodyPosition") | |
1694 | f.P=2000 | |
1695 | f.D=100 | |
1696 | f.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
1697 | if Type=="Damage" then | |
1698 | f.position=c.Position+Vector3.new(0,3,0) | |
1699 | elseif Type=="Debuff" or Type=="Interrupt" then | |
1700 | f.position=c.Position+Vector3.new(0,5,0) | |
1701 | end | |
1702 | f.Parent=c | |
1703 | game:GetService("Debris"):AddItem(m,5) | |
1704 | table.insert(Effects,{m,"showDamage",damgui,f,10,1,15,50,100}) | |
1705 | c.CanCollide=false | |
1706 | m.Parent=workspace | |
1707 | c.CanCollide=false | |
1708 | end | |
1709 | ||
1710 | function MagniDamage(Part,magni,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration) | |
1711 | for _,c in pairs(workspace:children()) do | |
1712 | local hum=c:findFirstChild("Humanoid") | |
1713 | if hum~=nil then | |
1714 | local head=nil | |
1715 | for _,d in pairs(c:children()) do | |
1716 | --if d.Name=="Torso" or d.Name=="Head" or d.Name=="HumanoidRootPart" or d.Name=="HitPart" then | |
1717 | --[[if d.className=="Model" and ranged~=true then | |
1718 | head=d:findFirstChild("Hitbox") | |
1719 | if d.Parent==Character then break end | |
1720 | if head~=nil then | |
1721 | local targ=head.Position-Part.Position | |
1722 | local mag=targ.magnitude | |
1723 | if mag<=magni then | |
1724 | ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Reference",vt()) | |
1725 | ref.Anchored=true | |
1726 | ref.CFrame=cf(head.Position) | |
1727 | game:GetService("Debris"):AddItem(ref,1) | |
1728 | hitnum=math.random(1,5) | |
1729 | if hitnum==1 then so("199148971",ref,1,1) | |
1730 | elseif hitnum==2 then so("199149025",ref,1,1) | |
1731 | elseif hitnum==3 then so("199149072",ref,1,1) | |
1732 | elseif hitnum==4 then so("199149109",ref,1,1) | |
1733 | elseif hitnum==5 then so("199149119",ref,1,1) | |
1734 | end | |
1735 | StaggerHit.Value=true | |
1736 | end | |
1737 | end | |
1738 | end]] | |
1739 | if d.className=="Part" then | |
1740 | head=d | |
1741 | if head~=nil then | |
1742 | local targ=head.Position-Part.Position | |
1743 | local mag=targ.magnitude | |
1744 | if mag<=magni and c.Name~=Character then | |
1745 | if stun==nil then | |
1746 | stun=math.random(5,10) | |
1747 | end | |
1748 | local Rang=nil | |
1749 | if Ranged==false then | |
1750 | Rang=true | |
1751 | end | |
1752 | local stag=nil | |
1753 | if shbash==true then | |
1754 | stag=true | |
1755 | end | |
1756 | Damagefunc(head,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged,DecreaseState,DecreaseAmount,Duration) | |
1757 | --Damagefunc(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,DecreaseState,DecreaseAmount,Duration) | |
1758 | end | |
1759 | end | |
1760 | end | |
1761 | end | |
1762 | end | |
1763 | end | |
1764 | end | |
1765 | local hold = false | |
1766 | function onKeyDown(key) | |
1767 | if attack==false then | |
1768 | if key=="z" then | |
1769 | ButtonPunch(true) | |
1770 | elseif key=="x" then | |
1771 | HeavyPunch(true) | |
1772 | elseif key=="c" then | |
1773 | Punch(true) | |
1774 | elseif key=="v" then | |
1775 | Punch(false) | |
1776 | elseif key == "b" then | |
1777 | HeavyPunch(false) | |
1778 | elseif key == "n" then | |
1779 | ButtonPunch(false) | |
1780 | elseif key == "m" then | |
1781 | ---DeathImpact() | |
1782 | elseif key == "f" then | |
1783 | ---Jump() | |
1784 | elseif key=="0" and hold == false then | |
1785 | hold = true | |
1786 | run.Parent=Decrease | |
1787 | end | |
1788 | end | |
1789 | end | |
1790 | function onKeyUp(key) | |
1791 | if attack==false then | |
1792 | if key=="0" and hold == true then | |
1793 | hold = false | |
1794 | run.Parent=nil | |
1795 | end | |
1796 | end | |
1797 | end | |
1798 | Mouse.KeyDown:connect(onKeyDown) | |
1799 | Mouse.KeyUp:connect(onKeyUp) | |
1800 | local stunnum=0 | |
1801 | local animnum=0 | |
1802 | local idle=1 | |
1803 | local animlimit=5 | |
1804 | local target,distance=nil,nil | |
1805 | local attacking=false | |
1806 | local stunanim=false | |
1807 | while Humanoid.Health>0 do | |
1808 | swait() | |
1809 | --[[print(target) | |
1810 | print(distance)]] | |
1811 | hitbox2.Parent=hitbox.Parent | |
1812 | hitbox2.Size=hitbox.Size | |
1813 | hitbox2.CFrame=hitboxCF | |
1814 | --[[for _,c in pairs(Character:children()) do | |
1815 | for _,v in pairs(c:children()) do | |
1816 | if v.className=="BodyGyro" or v.className=="BodyPosition" or v.className=="BodyVelocity" or v.className=="BodyAngularVelocity" then | |
1817 | if v.Name~="SiegmundGyro" and v.Name~="SiegmundPos" then | |
1818 | print("dai") | |
1819 | v.Parent=nil | |
1820 | end | |
1821 | end | |
1822 | end | |
1823 | end]] | |
1824 | coroutine.resume(coroutine.create(function() | |
1825 | if start==false then | |
1826 | start=true | |
1827 | --StartAnim() | |
1828 | end | |
1829 | end)) | |
1830 | if attack==false then | |
1831 | BodGy.cframe=cf(Torso.Position,Mouse.Hit.p) | |
1832 | end | |
1833 | target,distance=findNearestTorso(Torso.Position) | |
1834 | --[[if target~=nil then | |
1835 | if attack==false then | |
1836 | BodGy.cframe=cf(Torso.Position,target.Position) | |
1837 | end | |
1838 | numb1=RootPart.Position.y | |
1839 | numb2=target.Position.y | |
1840 | if numb2-numb1>=5 or numb2-numb1<=-5 then | |
1841 | if distance<=30 then | |
1842 | if attack==false then | |
1843 | attackrand=math.random(1,20) | |
1844 | if attackrand==1 then | |
1845 | coroutine.resume(coroutine.create(function() | |
1846 | RecentEnemy.Value=nil | |
1847 | JumpKick() | |
1848 | end)) | |
1849 | end | |
1850 | end | |
1851 | end | |
1852 | end | |
1853 | if distance>30 then --far range | |
1854 | Humanoid:MoveTo(target.Position) | |
1855 | run.Parent=Decrease | |
1856 | if attack==false then | |
1857 | attackrand=math.random(1,70) | |
1858 | if attackrand==1 then | |
1859 | coroutine.resume(coroutine.create(function() | |
1860 | RecentEnemy.Value=nil | |
1861 | EnergyBlam() | |
1862 | --[[d=math.random(1,3) | |
1863 | if d==1 then | |
1864 | PunchSlam() | |
1865 | elseif d==2 then | |
1866 | SweepCut() | |
1867 | elseif d==3 then | |
1868 | MultiKick() | |
1869 | end | |
1870 | end)) | |
1871 | --[[coroutine.resume(coroutine.create(function() | |
1872 | buffdef.Parent=Decrease | |
1873 | atk=0 | |
1874 | if stompcooldown<=0 then | |
1875 | atk=3 | |
1876 | else | |
1877 | atk=math.random(1,2) | |
1878 | end | |
1879 | if atk==1 then | |
1880 | Jump() | |
1881 | elseif atk==2 then | |
1882 | GrandeurDash() | |
1883 | elseif atk==3 then | |
1884 | DeathImpact() | |
1885 | end | |
1886 | buffdef.Parent=nil | |
1887 | end)) | |
1888 | end | |
1889 | end | |
1890 | elseif distance<=30 and distance>=5 then --mid range | |
1891 | move=distance*3 | |
1892 | Humanoid:MoveTo(target.Position) | |
1893 | run.Parent=nil | |
1894 | if attack==false then | |
1895 | attackrand=math.random(1,20) | |
1896 | if attackrand==1 then | |
1897 | coroutine.resume(coroutine.create(function() | |
1898 | RecentEnemy.Value=nil | |
1899 | d=math.random(1,3) | |
1900 | if d==1 then | |
1901 | PunchSlam() | |
1902 | elseif d==2 then | |
1903 | SweepCut() | |
1904 | elseif d==3 then | |
1905 | MultiKick() | |
1906 | end | |
1907 | end)) | |
1908 | --[[coroutine.resume(coroutine.create(function() | |
1909 | buffdef.Parent=Decrease | |
1910 | atk=0 | |
1911 | if stompcooldown<=0 then | |
1912 | atk=3 | |
1913 | else | |
1914 | atk=math.random(1,2) | |
1915 | end | |
1916 | if atk==1 then | |
1917 | HeavySlam() | |
1918 | elseif atk==2 then | |
1919 | GrandeurDash() | |
1920 | elseif atk==3 then | |
1921 | DeathImpact() | |
1922 | end | |
1923 | buffdef.Parent=nil | |
1924 | end)) | |
1925 | end | |
1926 | end | |
1927 | else --close range | |
1928 | move=10 | |
1929 | Humanoid:MoveTo(RootPart.Position) | |
1930 | run.Parent=nil | |
1931 | --run.Parent=nil | |
1932 | if attack==false then | |
1933 | attackrand=math.random(1,20) | |
1934 | if attackrand==1 then | |
1935 | coroutine.resume(coroutine.create(function() | |
1936 | RecentEnemy.Value=nil | |
1937 | d=math.random(1,3) | |
1938 | if d==1 then | |
1939 | PunchSlam() | |
1940 | elseif d==2 then | |
1941 | SweepCut() | |
1942 | elseif d==3 then | |
1943 | MultiKick() | |
1944 | end | |
1945 | end)) | |
1946 | --[[coroutine.resume(coroutine.create(function() | |
1947 | buffdef.Parent=Decrease | |
1948 | HeavyCombo("Stun") | |
1949 | buffdef.Parent=nil | |
1950 | end)) | |
1951 | end | |
1952 | end | |
1953 | end | |
1954 | end]] | |
1955 | if Mvmt.Value<0 or Stun.Value>=100 or attack==true then | |
1956 | Humanoid.WalkSpeed=0 | |
1957 | if jump==true then | |
1958 | Humanoid.WalkSpeed=16*Mvmt.Value | |
1959 | end | |
1960 | else | |
1961 | Humanoid.WalkSpeed=16*Mvmt.Value | |
1962 | end | |
1963 | if Stun.Value>=100 and stunanim==false then | |
1964 | coroutine.resume(coroutine.create(function() | |
1965 | stunanim=true | |
1966 | while attack==true do | |
1967 | swait() | |
1968 | end | |
1969 | StunAnim() | |
1970 | Stun.Value=0 | |
1971 | stunanim=false | |
1972 | end)) | |
1973 | end | |
1974 | local stunnum2=80 | |
1975 | if stunnum>=stunnum2 then | |
1976 | if Stun.Value>0 then | |
1977 | Stun.Value=Stun.Value-1 | |
1978 | end | |
1979 | stunnum=0 | |
1980 | end | |
1981 | stunnum=stunnum+1 | |
1982 | local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude | |
1983 | local velderp=RootPart.Velocity.y | |
1984 | hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,10,Character) | |
1985 | for _,c in pairs(Decrease:children()) do | |
1986 | if c:findFirstChild("Duration")~=nil then | |
1987 | c.Duration.Value=c.Duration.Value-1 | |
1988 | if c.Duration.Value<=0 then | |
1989 | c.Parent=nil | |
1990 | end | |
1991 | end | |
1992 | if c.Name=="DecreaseAtk" then | |
1993 | decreaseatk=decreaseatk+c.Value | |
1994 | elseif c.Name=="DecreaseDef" then | |
1995 | decreasedef=decreasedef+c.Value | |
1996 | elseif c.Name=="DecreaseMvmt" then | |
1997 | decreasemvmt=decreasemvmt+c.Value | |
1998 | end | |
1999 | end | |
2000 | Atk.Value=1-decreaseatk | |
2001 | if Atk.Value<=0 then | |
2002 | Atk.Value=0 | |
2003 | end | |
2004 | Def.Value=1-decreasedef | |
2005 | if Def.Value<=0 then | |
2006 | Def.Value=0.01 | |
2007 | end | |
2008 | Mvmt.Value=1-decreasemvmt | |
2009 | if Mvmt.Value<=0 then | |
2010 | Mvmt.Value=0 | |
2011 | end | |
2012 | decreaseatk=0 | |
2013 | decreasedef=0 | |
2014 | decreasemvmt=0 | |
2015 | AtkVal=Atk.Value*100 | |
2016 | AtkVal=math.floor(AtkVal) | |
2017 | AtkVal=AtkVal/100 | |
2018 | DefVal=Def.Value*100 | |
2019 | DefVal=math.floor(DefVal) | |
2020 | DefVal=DefVal/100 | |
2021 | MvmtVal=Mvmt.Value*100 | |
2022 | MvmtVal=math.floor(MvmtVal) | |
2023 | MvmtVal=MvmtVal/100 | |
2024 | if MvmtVal<=0 then | |
2025 | MvmtVal=0 | |
2026 | end | |
2027 | animnum=animnum+1 | |
2028 | if animnum>=animlimit*5 then | |
2029 | idle=1 | |
2030 | animnum=0 | |
2031 | elseif animnum>=animlimit*4 then | |
2032 | idle=1 | |
2033 | animnum=0 | |
2034 | elseif animnum>=animlimit*3 then | |
2035 | idle=4 | |
2036 | elseif animnum>=animlimit*2 then | |
2037 | idle=3 | |
2038 | elseif animnum>=animlimit*1 then | |
2039 | idle=2 | |
2040 | end | |
2041 | if RootPart.Velocity.y > 1 and hitfloor==nil then | |
2042 | Anim="Jump" | |
2043 | if attack==false then | |
2044 | Neck.C0=clerp(Neck.C0,necko*euler(.1,0,0),.3) | |
2045 | RootJoint.C0=clerp(RootJoint.C0,euler(-.1,0,0),.3) | |
2046 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,1),.3) | |
2047 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
2048 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-1),.3) | |
2049 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
2050 | RH.C0=clerp(RH.C0,cf(.5,-1,-.3)*euler(-0.5,1.57,0)*euler(-.2,0,0),.2) | |
2051 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.3)*euler(-0.5,-1.57,0)*euler(-.2,0,0),.2) | |
2052 | end | |
2053 | elseif RootPart.Velocity.y < -1 and hitfloor==nil then | |
2054 | Anim="Fall" | |
2055 | if attack==false then | |
2056 | Neck.C0=clerp(Neck.C0,necko*euler(-.4,0,0),.3) | |
2057 | RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0),.3) | |
2058 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.3,0,0.2),.3) | |
2059 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
2060 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.3,0,-0.2),.3) | |
2061 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
2062 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0.4,1.57,0),.2) | |
2063 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(-0.2,-1.57,0),.2) | |
2064 | end | |
2065 | elseif torvel<1 and hitfloor~=nil then | |
2066 | Anim="Idle" | |
2067 | animlimit=15 | |
2068 | if attack==false then | |
2069 | if idle==1 or idle==2 then | |
2070 | Neck.C0=clerp(Neck.C0,necko*euler(0,.5,0)*euler(0,0,0),.1) | |
2071 | RootJoint.C0=clerp(RootJoint.C0,euler(0,.5,0)*cf(0,.4,0),.1) | |
2072 | RW.C0=clerp(RW.C0,cf(1.3,0.4,.3)*euler(1,0,.2)*euler(0,-.5,0),.1) | |
2073 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2074 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.4,0,.5)*euler(0,1,0),.1) | |
2075 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2076 | RH.C0=clerp(RH.C0,cf(.6,-.9,0)*euler(0,1.57,0)*euler(0,-.1,-.05),.1) | |
2077 | LH.C0=clerp(LH.C0,cf(-.7,-.8,-.4)*euler(0,-1.57,0)*euler(0,.5,.1),.1) | |
2078 | else | |
2079 | Neck.C0=clerp(Neck.C0,necko*euler(.1,.5,0)*euler(0,0,0),.1) | |
2080 | RootJoint.C0=clerp(RootJoint.C0,euler(.1,.5,0)*euler(0,0,0)*cf(0,.6,0),.1) | |
2081 | RW.C0=clerp(RW.C0,cf(1.3,0.4,.3)*euler(.8,0,.4)*euler(0,-.5,0),.1) | |
2082 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2083 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.2)*euler(1.6,0,.2)*euler(0,1,0),.1) | |
2084 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2085 | RH.C0=clerp(RH.C0,cf(.7,-.7,-.5)*euler(0,1.57,0)*euler(0,-.1,-.2)*euler(.05,0,0),.1) | |
2086 | LH.C0=clerp(LH.C0,cf(-.6,-.6,-.8)*euler(0,-1.57,0)*euler(0,.5,.2)*euler(-.1,0,0),.1) | |
2087 | end | |
2088 | end | |
2089 | elseif torvel>2 and torvel<20 and hitfloor~=nil then | |
2090 | Anim="Walk" | |
2091 | animlimit=10 | |
2092 | if attack==false then | |
2093 | if idle==1 or idle==2 then | |
2094 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2095 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.4,0,-.1)*euler(0,0,0),.1) | |
2096 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2097 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,-.5),.1) | |
2098 | if idle==1 then | |
2099 | Neck.C0=clerp(Neck.C0,necko*euler(.05,0,0)*euler(0,0,0),.1) | |
2100 | RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,.1,0),.1) | |
2101 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,0)*euler(0,0,0),.1) | |
2102 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,-1.2),.1) | |
2103 | elseif idle==2 then | |
2104 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.1) | |
2105 | RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0)*cf(0,.2,0),.1) | |
2106 | RW.C0=clerp(RW.C0,cf(1.3,0.5,-.5)*euler(1.2,0,-.5)*euler(0,0,0),.1) | |
2107 | LH.C0=clerp(LH.C0,cf(-.5,-.9,-.3)*euler(0,-1.57,0)*euler(0,0,0),.1) | |
2108 | end | |
2109 | else | |
2110 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.4,0,.1)*euler(0,0,0),.1) | |
2111 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2112 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.1) | |
2113 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,.5),.1) | |
2114 | if idle==3 then | |
2115 | Neck.C0=clerp(Neck.C0,necko*euler(.05,0,0)*euler(0,0,0),.1) | |
2116 | RootJoint.C0=clerp(RootJoint.C0,euler(0,0,0)*cf(0,.1,0),.1) | |
2117 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1,0,0)*euler(0,0,0),.1) | |
2118 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,1.2),.1) | |
2119 | elseif idle==4 then | |
2120 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,0)*euler(0,0,0),.1) | |
2121 | RootJoint.C0=clerp(RootJoint.C0,euler(.2,0,0)*cf(0,.2,0),.1) | |
2122 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.5)*euler(1.2,0,.5)*euler(0,0,0),.1) | |
2123 | RH.C0=clerp(RH.C0,cf(.5,-.9,-.3)*euler(0,1.57,0)*euler(0,0,0),.1) | |
2124 | end | |
2125 | end | |
2126 | end | |
2127 | elseif torvel>=20 and hitfloor~=nil then | |
2128 | Anim="Run" | |
2129 | animlimit=10 | |
2130 | if attack==false then | |
2131 | if idle==1 or idle==2 then | |
2132 | Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0)*euler(0,0,0),.2) | |
2133 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
2134 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
2135 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(-.2,0,-.8),.2) | |
2136 | if idle==1 then | |
2137 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,.5)*euler(0,0,0),.2) | |
2138 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1,0,-.5)*euler(0,0,0),.2) | |
2139 | RootJoint.C0=clerp(RootJoint.C0,euler(.4,0,0)*cf(0,.3,0),.2) | |
2140 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(0,0,-1.5),.2) | |
2141 | elseif idle==2 then | |
2142 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.2,0,.3)*euler(0,0,0),.2) | |
2143 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.2,0,-.3)*euler(0,0,0),.2) | |
2144 | RootJoint.C0=clerp(RootJoint.C0,euler(.5,0,0)*cf(0,.4,0),.1) | |
2145 | LH.C0=clerp(LH.C0,cf(-.5,-.6,-.5)*euler(0,-1.57,0)*euler(0,0,-.5),.1) | |
2146 | end | |
2147 | else | |
2148 | Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0)*euler(0,0,0),.2) | |
2149 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
2150 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
2151 | LH.C0=clerp(LH.C0,cf(-.5,-1,0)*euler(0,-1.57,0)*euler(-.2,0,.8),.2) | |
2152 | if idle==3 then | |
2153 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,.5)*euler(0,0,0),.2) | |
2154 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1,0,-.5)*euler(0,0,0),.2) | |
2155 | RootJoint.C0=clerp(RootJoint.C0,euler(.4,0,0)*cf(0,.3,0),.2) | |
2156 | RH.C0=clerp(RH.C0,cf(.5,-1,0)*euler(0,1.57,0)*euler(0,0,1.5),.2) | |
2157 | elseif idle==4 then | |
2158 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.2,0,.3)*euler(0,0,0),.2) | |
2159 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-1.2,0,-.3)*euler(0,0,0),.2) | |
2160 | RootJoint.C0=clerp(RootJoint.C0,euler(.5,0,0)*cf(0,.4,0),.1) | |
2161 | RH.C0=clerp(RH.C0,cf(.5,-.6,-.5)*euler(0,1.57,0)*euler(0,0,.5),.1) | |
2162 | end | |
2163 | end | |
2164 | end | |
2165 | end | |
2166 | if #Effects>0 then | |
2167 | --table.insert(Effects,{prt,"Block1",delay}) | |
2168 | for e=1,#Effects do | |
2169 | if Effects[e]~=nil then | |
2170 | --for j=1,#Effects[e] do | |
2171 | local Thing=Effects[e] | |
2172 | if Thing~=nil then | |
2173 | local Part=Thing[1] | |
2174 | local Mode=Thing[2] | |
2175 | local Delay=Thing[3] | |
2176 | local IncX=Thing[4] | |
2177 | local IncY=Thing[5] | |
2178 | local IncZ=Thing[6] | |
2179 | if Thing[2]=="DecreaseStat" then | |
2180 | --table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration,d}) | |
2181 | Thing[5]=Thing[5]-1 | |
2182 | if Thing[5]<=0 then | |
2183 | if Thing[1]:findFirstChild("Stats")~=nil then | |
2184 | if Thing[1].Stats:findFirstChild("Decrease")~=nil then | |
2185 | --Thing[1].Stats[Thing[3]].Value=Thing[1].Stats[Thing[3]].Value+Thing[4] | |
2186 | end | |
2187 | end | |
2188 | Thing[6].Parent=nil | |
2189 | table.remove(Effects,e) | |
2190 | end | |
2191 | end | |
2192 | if Thing[2]=="CylinderClang" then | |
2193 | if Thing[3]<=1 then | |
2194 | Thing[1].CFrame=Thing[1].CFrame*CFrame.new(0,2.5*Thing[5],0)*CFrame.fromEulerAnglesXYZ(Thing[6],0,0) | |
2195 | Thing[7]=Thing[1].CFrame | |
2196 | effect("New Yeller",0,Thing[8],Thing[7]) | |
2197 | Thing[8]=Thing[7] | |
2198 | Thing[3]=Thing[3]+Thing[4] | |
2199 | else | |
2200 | Part.Parent=nil | |
2201 | table.remove(Effects,e) | |
2202 | end | |
2203 | end | |
2204 | if Thing[2]=="showDamage" then | |
2205 | if Thing[6]<Thing[5] then | |
2206 | Thing[6]=Thing[6]+1 | |
2207 | elseif Thing[6]<Thing[7] then | |
2208 | Thing[4].position=Thing[4].position+vt(0,-.2,0) | |
2209 | Thing[6]=Thing[6]+1 | |
2210 | elseif Thing[6]<Thing[8] then | |
2211 | Thing[6]=Thing[6]+1 | |
2212 | elseif Thing[6]<Thing[9] then | |
2213 | Thing[6]=Thing[6]+1 | |
2214 | Thing[4].position=Thing[4].position+vt(0,.2,0) | |
2215 | Thing[3].TextStrokeTransparency=Thing[3].TextStrokeTransparency+.1 | |
2216 | Thing[3].TextTransparency=Thing[3].TextTransparency+.1 | |
2217 | else | |
2218 | Thing[1].Parent=nil | |
2219 | table.remove(Effects,e) | |
2220 | end | |
2221 | end | |
2222 | if Thing[2]~="DecreaseStat" and Thing[2]~="showDamage" then | |
2223 | if Thing[1].Transparency<=1 then | |
2224 | if Thing[2]=="Block1" then | |
2225 | Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
2226 | Mesh=Thing[7] | |
2227 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
2228 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2229 | elseif Thing[2]=="Block2" then | |
2230 | Thing[1].CFrame=Thing[1].CFrame | |
2231 | Mesh=Thing[7] | |
2232 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
2233 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2234 | elseif Thing[2]=="Cylinder" then | |
2235 | Mesh=Thing[7] | |
2236 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
2237 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2238 | elseif Thing[2]=="Cylinder2" then | |
2239 | Mesh=Thing[7] | |
2240 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
2241 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2242 | if Thing[1].Transparency>=.5 then | |
2243 | Thing[1].BrickColor=BrickColor.new("Really black") | |
2244 | end | |
2245 | elseif Thing[2]=="Blood" then | |
2246 | Mesh=Thing[7] | |
2247 | Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0) | |
2248 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
2249 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2250 | elseif Thing[2]=="Elec" then | |
2251 | Mesh=Thing[7] | |
2252 | Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9]) | |
2253 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2254 | elseif Thing[2]=="Disappear" then | |
2255 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
2256 | end | |
2257 | else | |
2258 | table.remove(Effects,e) | |
2259 | Thing[1].Parent=nil | |
2260 | end | |
2261 | end | |
2262 | end | |
2263 | --end | |
2264 | end | |
2265 | end | |
2266 | end | |
2267 | end |