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 | Player=game:GetService("Players").LocalPlayer | |
305 | Character=Player.Character | |
306 | PlayerGui=Player.PlayerGui | |
307 | Backpack=Player.Backpack | |
308 | Torso=Character.Torso | |
309 | Head=Character.Head | |
310 | Humanoid=Character.Humanoid | |
311 | LeftArm=Character["Left Arm"] | |
312 | LeftLeg=Character["Left Leg"] | |
313 | RightArm=Character["Right Arm"] | |
314 | RightLeg=Character["Right Leg"] | |
315 | LS=Torso["Left Shoulder"] | |
316 | LH=Torso["Left Hip"] | |
317 | RS=Torso["Right Shoulder"] | |
318 | RH=Torso["Right Hip"] | |
319 | Face = Head.face | |
320 | Neck=Torso.Neck | |
321 | it=Instance.new | |
322 | attacktype=1 | |
323 | vt=Vector3.new | |
324 | cf=CFrame.new | |
325 | euler=CFrame.fromEulerAnglesXYZ | |
326 | angles=CFrame.Angles | |
327 | cloaked=false | |
328 | necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
329 | necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
330 | LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0) | |
331 | LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0) | |
332 | RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0) | |
333 | RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0) | |
334 | RootPart=Character.HumanoidRootPart | |
335 | RootJoint=RootPart.RootJoint | |
336 | RootCF=euler(-1.57,0,3.14) | |
337 | attack = false | |
338 | attackdebounce = false | |
339 | deb=false | |
340 | equipped=true | |
341 | hand=false | |
342 | MMouse=nil | |
343 | combo=0 | |
344 | mana=0 | |
345 | trispeed=.2 | |
346 | attackmode='none' | |
347 | local idle=0 | |
348 | local Anim="Idle" | |
349 | local Effects={} | |
350 | local gun=false | |
351 | local shoot=false | |
352 | player=nil | |
353 | mana=0 | |
354 | cam = workspace.CurrentCamera | |
355 | ZTarget = nil | |
356 | RocketTarget = nil | |
357 | local m = Instance.new("Model",Character) | |
358 | m.Name = "WeaponModel" | |
359 | ||
360 | mouse=Player:GetMouse() | |
361 | --save shoulders | |
362 | RSH, LSH=nil, nil | |
363 | --welds | |
364 | RW, LW=Instance.new("Weld"), Instance.new("Weld") | |
365 | RW.Name="Right Shoulder" LW.Name="Left Shoulder" | |
366 | LH=Torso["Left Hip"] | |
367 | RH=Torso["Right Hip"] | |
368 | TorsoColor=Torso.BrickColor | |
369 | function NoOutline(Part) | |
370 | Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10 | |
371 | end | |
372 | player=Player | |
373 | ch=Character | |
374 | RSH=ch.Torso["Right Shoulder"] | |
375 | LSH=ch.Torso["Left Shoulder"] | |
376 | -- | |
377 | RSH.Parent=nil | |
378 | LSH.Parent=nil | |
379 | -- | |
380 | RW.Name="Right Shoulder" | |
381 | RW.Part0=ch.Torso | |
382 | RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5) | |
383 | RW.C1=cf(0, 0.5, 0) | |
384 | RW.Part1=ch["Right Arm"] | |
385 | RW.Parent=ch.Torso | |
386 | -- | |
387 | LW.Name="Left Shoulder" | |
388 | LW.Part0=ch.Torso | |
389 | LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8) | |
390 | LW.C1=cf(0, 0.5, 0) | |
391 | LW.Part1=ch["Left Arm"] | |
392 | LW.Parent=ch.Torso | |
393 | ||
394 | function swait(num) | |
395 | if num==0 or num==nil then | |
396 | game:service'RunService'.Heartbeat:wait(0) | |
397 | else | |
398 | for i=0,num do | |
399 | game:service'RunService'.Heartbeat:wait(0) | |
400 | end | |
401 | end | |
402 | end | |
403 | ||
404 | function nooutline(part) | |
405 | part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10 | |
406 | end | |
407 | ||
408 | function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size) | |
409 | local fp=it("Part") | |
410 | fp.formFactor=formfactor | |
411 | fp.Parent=parent | |
412 | fp.Reflectance=reflectance | |
413 | fp.Transparency=transparency | |
414 | fp.CanCollide=false | |
415 | fp.Locked=true | |
416 | fp.BrickColor=BrickColor.new(tostring(brickcolor)) | |
417 | fp.Name=name | |
418 | fp.Size=size | |
419 | fp.Position=Character.Torso.Position | |
420 | nooutline(fp) | |
421 | fp.Material=material | |
422 | fp:BreakJoints() | |
423 | return fp | |
424 | end | |
425 | ||
426 | function mesh(Mesh,part,meshtype,meshid,offset,scale) | |
427 | local mesh=it(Mesh) | |
428 | mesh.Parent=part | |
429 | if Mesh=="SpecialMesh" then | |
430 | mesh.MeshType=meshtype | |
431 | mesh.MeshId=meshid | |
432 | end | |
433 | mesh.Offset=offset | |
434 | mesh.Scale=scale | |
435 | return mesh | |
436 | end | |
437 | ||
438 | function weld(parent,part0,part1,c0,c1) | |
439 | local weld=it("Weld") | |
440 | weld.Parent=parent | |
441 | weld.Part0=part0 | |
442 | weld.Part1=part1 | |
443 | weld.C0=c0 | |
444 | weld.C1=c1 | |
445 | return weld | |
446 | end | |
447 | ||
448 | ||
449 | local function CFrameFromTopBack(at, top, back) | |
450 | local right = top:Cross(back) | |
451 | return CFrame.new(at.x, at.y, at.z, | |
452 | right.x, top.x, back.x, | |
453 | right.y, top.y, back.y, | |
454 | right.z, top.z, back.z) | |
455 | end | |
456 | ||
457 | function Triangle(a, b, c) | |
458 | local edg1 = (c-a):Dot((b-a).unit) | |
459 | local edg2 = (a-b):Dot((c-b).unit) | |
460 | local edg3 = (b-c):Dot((a-c).unit) | |
461 | if edg1 <= (b-a).magnitude and edg1 >= 0 then | |
462 | a, b, c = a, b, c | |
463 | elseif edg2 <= (c-b).magnitude and edg2 >= 0 then | |
464 | a, b, c = b, c, a | |
465 | elseif edg3 <= (a-c).magnitude and edg3 >= 0 then | |
466 | a, b, c = c, a, b | |
467 | else | |
468 | assert(false, "unreachable") | |
469 | end | |
470 | ||
471 | local len1 = (c-a):Dot((b-a).unit) | |
472 | local len2 = (b-a).magnitude - len1 | |
473 | local width = (a + (b-a).unit*len1 - c).magnitude | |
474 | ||
475 | local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit) | |
476 | ||
477 | local list = {} | |
478 | ||
479 | local TrailColor = ("Dark grey") | |
480 | ||
481 | if len1 > 0.01 then | |
482 | local w1 = Instance.new('WedgePart', m) | |
483 | game:GetService("Debris"):AddItem(w1,5) | |
484 | w1.Material = "SmoothPlastic" | |
485 | w1.FormFactor = 'Custom' | |
486 | w1.BrickColor = BrickColor.new(TrailColor) | |
487 | w1.Transparency = 0 | |
488 | w1.Reflectance = 0 | |
489 | w1.Material = "SmoothPlastic" | |
490 | w1.CanCollide = false | |
491 | NoOutline(w1) | |
492 | local sz = Vector3.new(0.2, width, len1) | |
493 | w1.Size = sz | |
494 | local sp = Instance.new("SpecialMesh",w1) | |
495 | sp.MeshType = "Wedge" | |
496 | sp.Scale = Vector3.new(0,1,1) * sz/w1.Size | |
497 | w1:BreakJoints() | |
498 | w1.Anchored = true | |
499 | w1.Parent = workspace | |
500 | w1.Transparency = 0.7 | |
501 | table.insert(Effects,{w1,"Disappear",.01}) | |
502 | w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2) | |
503 | table.insert(list,w1) | |
504 | end | |
505 | ||
506 | if len2 > 0.01 then | |
507 | local w2 = Instance.new('WedgePart', m) | |
508 | game:GetService("Debris"):AddItem(w2,5) | |
509 | w2.Material = "SmoothPlastic" | |
510 | w2.FormFactor = 'Custom' | |
511 | w2.BrickColor = BrickColor.new(TrailColor) | |
512 | w2.Transparency = 0 | |
513 | w2.Reflectance = 0 | |
514 | w2.Material = "SmoothPlastic" | |
515 | w2.CanCollide = false | |
516 | NoOutline(w2) | |
517 | local sz = Vector3.new(0.2, width, len2) | |
518 | w2.Size = sz | |
519 | local sp = Instance.new("SpecialMesh",w2) | |
520 | sp.MeshType = "Wedge" | |
521 | sp.Scale = Vector3.new(0,1,1) * sz/w2.Size | |
522 | w2:BreakJoints() | |
523 | w2.Anchored = true | |
524 | w2.Parent = workspace | |
525 | w2.Transparency = 0.7 | |
526 | table.insert(Effects,{w2,"Disappear",.01}) | |
527 | w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2) | |
528 | table.insert(list,w2) | |
529 | end | |
530 | return unpack(list) | |
531 | end | |
532 | ||
533 | ||
534 | so = function(id,par,vol,pit) | |
535 | coroutine.resume(coroutine.create(function() | |
536 | local sou = Instance.new("Sound",par or workspace) | |
537 | sou.Volume=vol | |
538 | sou.Pitch=pit or 1 | |
539 | sou.SoundId=id | |
540 | swait() | |
541 | sou:play() | |
542 | game:GetService("Debris"):AddItem(sou,6) | |
543 | end)) | |
544 | end | |
545 | ||
546 | function clerp(a,b,t) | |
547 | local qa = {QuaternionFromCFrame(a)} | |
548 | local qb = {QuaternionFromCFrame(b)} | |
549 | local ax, ay, az = a.x, a.y, a.z | |
550 | local bx, by, bz = b.x, b.y, b.z | |
551 | local _t = 1-t | |
552 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
553 | end | |
554 | ||
555 | function QuaternionFromCFrame(cf) | |
556 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
557 | local trace = m00 + m11 + m22 | |
558 | if trace > 0 then | |
559 | local s = math.sqrt(1 + trace) | |
560 | local recip = 0.5/s | |
561 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
562 | else | |
563 | local i = 0 | |
564 | if m11 > m00 then | |
565 | i = 1 | |
566 | end | |
567 | if m22 > (i == 0 and m00 or m11) then | |
568 | i = 2 | |
569 | end | |
570 | if i == 0 then | |
571 | local s = math.sqrt(m00-m11-m22+1) | |
572 | local recip = 0.5/s | |
573 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
574 | elseif i == 1 then | |
575 | local s = math.sqrt(m11-m22-m00+1) | |
576 | local recip = 0.5/s | |
577 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
578 | elseif i == 2 then | |
579 | local s = math.sqrt(m22-m00-m11+1) | |
580 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
581 | end | |
582 | end | |
583 | end | |
584 | ||
585 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
586 | local xs, ys, zs = x + x, y + y, z + z | |
587 | local wx, wy, wz = w*xs, w*ys, w*zs | |
588 | local xx = x*xs | |
589 | local xy = x*ys | |
590 | local xz = x*zs | |
591 | local yy = y*ys | |
592 | local yz = y*zs | |
593 | local zz = z*zs | |
594 | 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)) | |
595 | end | |
596 | ||
597 | function QuaternionSlerp(a, b, t) | |
598 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
599 | local startInterp, finishInterp; | |
600 | if cosTheta >= 0.0001 then | |
601 | if (1 - cosTheta) > 0.0001 then | |
602 | local theta = math.acos(cosTheta) | |
603 | local invSinTheta = 1/math.sin(theta) | |
604 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
605 | finishInterp = math.sin(t*theta)*invSinTheta | |
606 | else | |
607 | startInterp = 1-t | |
608 | finishInterp = t | |
609 | end | |
610 | else | |
611 | if (1+cosTheta) > 0.0001 then | |
612 | local theta = math.acos(-cosTheta) | |
613 | local invSinTheta = 1/math.sin(theta) | |
614 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
615 | finishInterp = math.sin(t*theta)*invSinTheta | |
616 | else | |
617 | startInterp = t-1 | |
618 | finishInterp = t | |
619 | end | |
620 | end | |
621 | 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 | |
622 | end | |
623 | ||
624 | function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants | |
625 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
626 | end | |
627 | ||
628 | Damagefunc=function(Part,hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,decreaseblock) | |
629 | if hit.Parent==nil then | |
630 | return | |
631 | end | |
632 | local h=hit.Parent:FindFirstChild("Humanoid") | |
633 | for _,v in pairs(hit.Parent:children()) do | |
634 | if v:IsA("Humanoid") then | |
635 | h=v | |
636 | end | |
637 | end | |
638 | if hit.Parent.Parent:FindFirstChild("Torso")~=nil then | |
639 | h=hit.Parent.Parent:FindFirstChild("Humanoid") | |
640 | end | |
641 | if hit.Parent.className=="Hat" then | |
642 | hit=hit.Parent.Parent:findFirstChild("Head") | |
643 | end | |
644 | if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then | |
645 | if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end | |
646 | --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then | |
647 | return | |
648 | end]] | |
649 | -- hs(hit,1.2) | |
650 | local c=Instance.new("ObjectValue") | |
651 | c.Name="creator" | |
652 | c.Value=game:service("Players").LocalPlayer | |
653 | c.Parent=h | |
654 | game:GetService("Debris"):AddItem(c,.5) | |
655 | local Damage=math.random(minim,maxim) | |
656 | -- h:TakeDamage(Damage) | |
657 | local blocked=false | |
658 | local block=hit.Parent:findFirstChild("Block") | |
659 | if block~=nil then | |
660 | print(block.className) | |
661 | if block.className=="NumberValue" then | |
662 | if block.Value>0 then | |
663 | blocked=true | |
664 | if decreaseblock==nil then | |
665 | block.Value=block.Value-1 | |
666 | end | |
667 | end | |
668 | end | |
669 | if block.className=="IntValue" then | |
670 | if block.Value>0 then | |
671 | blocked=true | |
672 | if decreaseblock~=nil then | |
673 | block.Value=block.Value-1 | |
674 | end | |
675 | end | |
676 | end | |
677 | end | |
678 | if blocked==false then | |
679 | -- h:TakeDamage(Damage) | |
680 | h.Health=h.Health-Damage | |
681 | ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color) | |
682 | else | |
683 | h.Health=h.Health-(Damage/2) | |
684 | ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, BrickColor.new("Bright blue").Color) | |
685 | end | |
686 | if Type=="Knockdown" then | |
687 | local hum=hit.Parent.Humanoid | |
688 | hum.PlatformStand=true | |
689 | coroutine.resume(coroutine.create(function(HHumanoid) | |
690 | swait(1) | |
691 | HHumanoid.PlatformStand=false | |
692 | end),hum) | |
693 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
694 | --hit.CFrame=CFrame.new(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0) | |
695 | local bodvol=Instance.new("BodyVelocity") | |
696 | bodvol.velocity=angle*knockback | |
697 | bodvol.P=5000 | |
698 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
699 | bodvol.Parent=hit | |
700 | local rl=Instance.new("BodyAngularVelocity") | |
701 | rl.P=3000 | |
702 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
703 | rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)) | |
704 | rl.Parent=hit | |
705 | game:GetService("Debris"):AddItem(bodvol,.5) | |
706 | game:GetService("Debris"):AddItem(rl,.5) | |
707 | elseif Type=="Normal" then | |
708 | local vp=Instance.new("BodyVelocity") | |
709 | vp.P=500 | |
710 | vp.maxForce=Vector3.new(math.huge,0,math.huge) | |
711 | -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback | |
712 | if KnockbackType==1 then | |
713 | vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05 | |
714 | elseif KnockbackType==2 then | |
715 | vp.velocity=Property.CFrame.lookVector*knockback | |
716 | end | |
717 | if knockback>0 then | |
718 | vp.Parent=hit.Parent.Torso | |
719 | end | |
720 | game:GetService("Debris"):AddItem(vp,.5) | |
721 | elseif Type=="Up" then | |
722 | local bodyVelocity=Instance.new("BodyVelocity") | |
723 | bodyVelocity.velocity=vt(0,60,0) | |
724 | bodyVelocity.P=5000 | |
725 | bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
726 | bodyVelocity.Parent=hit | |
727 | game:GetService("Debris"):AddItem(bodyVelocity,1) | |
728 | local rl=Instance.new("BodyAngularVelocity") | |
729 | rl.P=3000 | |
730 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
731 | rl.angularvelocity=Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30)) | |
732 | rl.Parent=hit | |
733 | game:GetService("Debris"):AddItem(rl,.5) | |
734 | elseif Type=="Snare" then | |
735 | local bp=Instance.new("BodyPosition") | |
736 | bp.P=2000 | |
737 | bp.D=100 | |
738 | bp.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
739 | bp.position=hit.Parent.Torso.Position | |
740 | bp.Parent=hit.Parent.Torso | |
741 | game:GetService("Debris"):AddItem(bp,1) | |
742 | elseif Type=="Target" then | |
743 | local Targetting = false | |
744 | if Targetting==false then | |
745 | ZTarget=hit.Parent.Torso | |
746 | coroutine.resume(coroutine.create(function(Part) | |
747 | so("http://www.roblox.com/asset/?id=15666462",Part,1,1.5) | |
748 | swait(5) | |
749 | so("http://www.roblox.com/asset/?id=15666462",Part,1,1.5) | |
750 | end),ZTarget) | |
751 | local TargHum=ZTarget.Parent:findFirstChild("Humanoid") | |
752 | local targetgui=Instance.new("BillboardGui") | |
753 | targetgui.Parent=ZTarget | |
754 | targetgui.Size=UDim2.new(10,100,10,100) | |
755 | local targ=Instance.new("ImageLabel") | |
756 | targ.Parent=targetgui | |
757 | targ.BackgroundTransparency=1 | |
758 | targ.Image="rbxassetid://4834067" | |
759 | targ.Size=UDim2.new(1,0,1,0) | |
760 | cam.CameraType="Scriptable" | |
761 | cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position) | |
762 | local dir=Vector3.new(cam.CoordinateFrame.lookVector.x,0,cam.CoordinateFrame.lookVector.z) | |
763 | workspace.CurrentCamera.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position) | |
764 | Targetting=true | |
765 | RocketTarget=ZTarget | |
766 | for i=1,Property do | |
767 | --while Targetting==true and Humanoid.Health>0 and Character.Parent~=nil do | |
768 | if Humanoid.Health>0 and Character.Parent~=nil and TargHum.Health>0 and TargHum.Parent~=nil and Targetting==true then | |
769 | swait() | |
770 | end | |
771 | --workspace.CurrentCamera.CoordinateFrame=CFrame.new(Head.CFrame.p,Head.CFrame.p+rmdir*100) | |
772 | cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position) | |
773 | dir=Vector3.new(cam.CoordinateFrame.lookVector.x,0,cam.CoordinateFrame.lookVector.z) | |
774 | cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position)*cf(0,5,10)*euler(-0.3,0,0) | |
775 | end | |
776 | Targetting=false | |
777 | RocketTarget=nil | |
778 | targetgui.Parent=nil | |
779 | cam.CameraType="Custom" | |
780 | end | |
781 | end | |
782 | local debounce=Instance.new("BoolValue") | |
783 | debounce.Name="DebounceHit" | |
784 | debounce.Parent=hit.Parent | |
785 | debounce.Value=true | |
786 | game:GetService("Debris"):AddItem(debounce,Delay) | |
787 | c=Instance.new("ObjectValue") | |
788 | c.Name="creator" | |
789 | c.Value=Player | |
790 | c.Parent=h | |
791 | game:GetService("Debris"):AddItem(c,.5) | |
792 | end | |
793 | end | |
794 | ||
795 | ||
796 | function ShowDamage(Pos, Text, Time, Color) | |
797 | local Rate = (1 / 30) | |
798 | local Pos = (Pos or Vector3.new(0, 0, 0)) | |
799 | local Text = (Text or "") | |
800 | local Time = (Time or 2) | |
801 | local Color = (Color or Color3.new(1, 0, 0)) | |
802 | local EffectPart = part("Custom",workspace,"SmoothPlastic",0,1,BrickColor.new(Color),"Effect",vt(0,0,0)) | |
803 | EffectPart.Anchored = true | |
804 | local BillboardGui = Instance.new("BillboardGui") | |
805 | BillboardGui.Size = UDim2.new(3, 0, 3, 0) | |
806 | BillboardGui.Adornee = EffectPart | |
807 | local TextLabel = Instance.new("TextLabel") | |
808 | TextLabel.BackgroundTransparency = 1 | |
809 | TextLabel.Size = UDim2.new(1, 0, 1, 0) | |
810 | TextLabel.Text = Text | |
811 | TextLabel.TextColor3 = Color | |
812 | TextLabel.TextScaled = true | |
813 | TextLabel.Font = Enum.Font.ArialBold | |
814 | TextLabel.Parent = BillboardGui | |
815 | BillboardGui.Parent = EffectPart | |
816 | game.Debris:AddItem(EffectPart, (Time + 0.1)) | |
817 | EffectPart.Parent = game:GetService("Workspace") | |
818 | Delay(0, function() | |
819 | local Frames = (Time / Rate) | |
820 | for Frame = 1, Frames do | |
821 | wait(Rate) | |
822 | local Percent = (Frame / Frames) | |
823 | EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0) | |
824 | TextLabel.TextTransparency = Percent | |
825 | end | |
826 | if EffectPart and EffectPart.Parent then | |
827 | EffectPart:Destroy() | |
828 | end | |
829 | end) | |
830 | end | |
831 | ||
832 | --example: local con = HitboxB.Touched:connect(function(hit) Damagefunc(Hitbox,hit,Dmg,Dmg,math.random(Knockback,Knockback),"Normal",RootPart,.2,1) end) | |
833 | ||
834 | ||
835 | ||
836 | function attackone() | |
837 | attack = true | |
838 | for i = 1,50 do | |
839 | so("rbxassetid://218056315",workspace,1,1) | |
840 | end | |
841 | for i = 1,40 do | |
842 | swait() | |
843 | for i = 0,1,0.2 do | |
844 | swait() | |
845 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-30),math.rad(0),math.rad(0)),.3) | |
846 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-30),math.rad(0),math.rad(0)),.3) | |
847 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(20)), 0.3) | |
848 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(-50)), 0.3) | |
849 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3) | |
850 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3) | |
851 | end | |
852 | for i = 0,1,0.2 do | |
853 | swait() | |
854 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
855 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
856 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-20)), 0.3) | |
857 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-20)), 0.3) | |
858 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3) | |
859 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(-20)),.3) | |
860 | end | |
861 | for i = 0,1,0.2 do | |
862 | swait() | |
863 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-30),math.rad(0),math.rad(0)),.3) | |
864 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-30),math.rad(0),math.rad(0)),.3) | |
865 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(20)), 0.3) | |
866 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(-50)), 0.3) | |
867 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3) | |
868 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3) | |
869 | end | |
870 | for i = 0,1,0.2 do | |
871 | swait() | |
872 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
873 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
874 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(20)), 0.3) | |
875 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-20)), 0.3) | |
876 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3) | |
877 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(-20)),.3) | |
878 | end | |
879 | end | |
880 | attack = false | |
881 | end | |
882 | ||
883 | mouse.Button1Down:connect(function() | |
884 | if attack == false and attacktype == 1 then | |
885 | attacktype = 1 | |
886 | attackone() | |
887 | end | |
888 | end) | |
889 | ||
890 | mouse.KeyDown:connect(function(k) | |
891 | k=k:lower() | |
892 | if attack == false and k == '' then | |
893 | ||
894 | end | |
895 | end) | |
896 | ||
897 | local sine = 0 | |
898 | local change = 1 | |
899 | local val = 0 | |
900 | ||
901 | while true do | |
902 | swait() | |
903 | sine = sine + change | |
904 | local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude | |
905 | local velderp=RootPart.Velocity.y | |
906 | hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character) | |
907 | if equipped==true or equipped==false then | |
908 | if attack==false then | |
909 | idle=idle+1 | |
910 | else | |
911 | idle=0 | |
912 | end | |
913 | if idle>=500 then | |
914 | if attack==false then | |
915 | end | |
916 | end | |
917 | if RootPart.Velocity.y > 1 and hitfloor==nil then | |
918 | Anim="Jump" | |
919 | if attack==false then | |
920 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
921 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
922 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3) | |
923 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3) | |
924 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
925 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
926 | end | |
927 | elseif RootPart.Velocity.y < -1 and hitfloor==nil then | |
928 | Anim="Fall" | |
929 | if attack==false then | |
930 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
931 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
932 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3) | |
933 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3) | |
934 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
935 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
936 | end | |
937 | elseif torvel<1 and hitfloor~=nil then | |
938 | Anim="Idle" | |
939 | if attack==false then | |
940 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
941 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
942 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3) | |
943 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3) | |
944 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
945 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
946 | end | |
947 | elseif torvel>2 and hitfloor~=nil then | |
948 | Anim="Walk" | |
949 | if attack==false then | |
950 | change=3 | |
951 | RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
952 | Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
953 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3) | |
954 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3) | |
955 | RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
956 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
957 | end | |
958 | end | |
959 | end | |
960 | if #Effects>0 then | |
961 | for e=1,#Effects do | |
962 | if Effects[e]~=nil then | |
963 | local Thing=Effects[e] | |
964 | if Thing~=nil then | |
965 | local Part=Thing[1] | |
966 | local Mode=Thing[2] | |
967 | local Delay=Thing[3] | |
968 | local IncX=Thing[4] | |
969 | local IncY=Thing[5] | |
970 | local IncZ=Thing[6] | |
971 | if Thing[1].Transparency<=1 then | |
972 | if Thing[2]=="Block1" then | |
973 | Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
974 | Mesh=Thing[1].Mesh | |
975 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
976 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
977 | elseif Thing[2]=="Cylinder" then | |
978 | Mesh=Thing[1].Mesh | |
979 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
980 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
981 | elseif Thing[2]=="Blood" then | |
982 | Mesh=Thing[7] | |
983 | Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0) | |
984 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
985 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
986 | elseif Thing[2]=="Elec" then | |
987 | Mesh=Thing[1].Mesh | |
988 | Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9]) | |
989 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
990 | elseif Thing[2]=="Disappear" then | |
991 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
992 | end | |
993 | else | |
994 | Part.Parent=nil | |
995 | table.remove(Effects,e) | |
996 | end | |
997 | end | |
998 | end | |
999 | end | |
1000 | end | |
1001 | end |