SHOW:
|
|
- or go back to the newest paste.
1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
3 | local Player,game,owner = owner,game | |
4 | local RealPlayer = Player | |
5 | do | |
6 | print("FE Compatibility code V2 by Mokiros") | |
7 | local RealPlayer = RealPlayer | |
8 | script.Parent = RealPlayer.Character | |
9 | ||
10 | --Fake event to make stuff like Mouse.KeyDown work | |
11 | local Disconnect_Function = function(this) | |
12 | this[1].Functions[this[2]] = nil | |
13 | end | |
14 | local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}} | |
15 | local FakeEvent_Metatable = {__index={ | |
16 | Connect = function(this,f) | |
17 | local i = tostring(math.random(0,10000)) | |
18 | while this.Functions[i] do | |
19 | i = tostring(math.random(0,10000)) | |
20 | end | |
21 | this.Functions[i] = f | |
22 | return setmetatable({this,i},Disconnect_Metatable) | |
23 | end | |
24 | }} | |
25 | FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect | |
26 | local function fakeEvent() | |
27 | return setmetatable({Functions={}},FakeEvent_Metatable) | |
28 | end | |
29 | ||
30 | --Creating fake input objects with fake variables | |
31 | local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()} | |
32 | FakeMouse.keyUp = FakeMouse.KeyUp | |
33 | FakeMouse.keyDown = FakeMouse.KeyDown | |
34 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
35 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
36 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
37 | end} | |
38 | --Merged 2 functions into one by checking amount of arguments | |
39 | CAS.UnbindAction = CAS.BindAction | |
40 | ||
41 | --This function will trigger the events that have been :Connect()'ed | |
42 | local function TriggerEvent(self,ev,...) | |
43 | for _,f in pairs(self[ev].Functions) do | |
44 | f(...) | |
45 | end | |
46 | end | |
47 | FakeMouse.TriggerEvent = TriggerEvent | |
48 | UIS.TriggerEvent = TriggerEvent | |
49 | ||
50 | --Client communication | |
51 | local Event = Instance.new("RemoteEvent") | |
52 | Event.Name = "UserInput_Event" | |
53 | Event.OnServerEvent:Connect(function(plr,io) | |
54 | if plr~=RealPlayer then return end | |
55 | FakeMouse.Target = io.Target | |
56 | FakeMouse.Hit = io.Hit | |
57 | if not io.isMouse then | |
58 | local b = io.UserInputState == Enum.UserInputState.Begin | |
59 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
60 | return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up") | |
61 | end | |
62 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
63 | return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up") | |
64 | end | |
65 | for _,t in pairs(CAS.Actions) do | |
66 | for _,k in pairs(t.Keys) do | |
67 | if k==io.KeyCode then | |
68 | t.Function(t.Name,io.UserInputState,io) | |
69 | end | |
70 | end | |
71 | end | |
72 | FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
73 | UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false) | |
74 | end | |
75 | end) | |
76 | Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event") | |
77 | local Mouse = owner:GetMouse() | |
78 | local UIS = game:GetService("UserInputService") | |
79 | local input = function(io,RobloxHandled) | |
80 | if RobloxHandled then return end | |
81 | --Since InputObject is a client-side instance, we create and pass table instead | |
82 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) | |
83 | end | |
84 | UIS.InputBegan:Connect(input) | |
85 | UIS.InputEnded:Connect(input) | |
86 | ||
87 | local h,t | |
88 | --Give the server mouse data every second frame, but only if the values changed | |
89 | --If player is not moving their mouse, client won't fire events | |
90 | local HB = game:GetService("RunService").Heartbeat | |
91 | while true do | |
92 | if h~=Mouse.Hit or t~=Mouse.Target then | |
93 | h,t=Mouse.Hit,Mouse.Target | |
94 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
95 | end | |
96 | --Wait 2 frames | |
97 | for i=1,2 do | |
98 | HB:Wait() | |
99 | end | |
100 | end]==],script) | |
101 | ||
102 | ----Sandboxed game object that allows the usage of client-side methods and services | |
103 | --Real game object | |
104 | local RealGame = game | |
105 | ||
106 | --Metatable for fake service | |
107 | local FakeService_Metatable = { | |
108 | __index = function(self,k) | |
109 | local s = rawget(self,"_RealService") | |
110 | if s then | |
111 | return typeof(s[k])=="function" | |
112 | and function(_,...)return s[k](s,...)end or s[k] | |
113 | end | |
114 | end, | |
115 | __newindex = function(self,k,v) | |
116 | local s = rawget(self,"_RealService") | |
117 | if s then s[k]=v end | |
118 | end | |
119 | } | |
120 | local function FakeService(t,RealService) | |
121 | t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService | |
122 | return setmetatable(t,FakeService_Metatable) | |
123 | end | |
124 | ||
125 | --Fake game object | |
126 | local FakeGame = { | |
127 | GetService = function(self,s) | |
128 | return rawget(self,s) or RealGame:GetService(s) | |
129 | end, | |
130 | Players = FakeService({ | |
131 | LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player) | |
132 | },"Players"), | |
133 | UserInputService = FakeService(UIS,"UserInputService"), | |
134 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
135 | RunService = FakeService({ | |
136 | _btrs = {}, | |
137 | RenderStepped = RealGame:GetService("RunService").Heartbeat, | |
138 | BindToRenderStep = function(self,name,_,fun) | |
139 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
140 | end, | |
141 | UnbindFromRenderStep = function(self,name) | |
142 | self._btrs[name]:Disconnect() | |
143 | end, | |
144 | },"RunService") | |
145 | } | |
146 | rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer) | |
147 | FakeGame.service = FakeGame.GetService | |
148 | FakeService(FakeGame,game) | |
149 | --Changing owner to fake player object to support owner:GetMouse() | |
150 | game,owner = FakeGame,FakeGame.Players.LocalPlayer | |
151 | end | |
152 | ||
153 | ||
154 | ||
155 | ||
156 | --[[ last updated: 2018/5/13, 15:30 | |
157 | ||
158 | Pen by oilsauce.]] | |
159 | ||
160 | print("Pen Script by Oilsauce.") | |
161 | print("Click: Stab") | |
162 | print("E: Toggle Pen") | |
163 | print("F: Throw Pen") | |
164 | ||
165 | ----------------------------------------------------------------------------------- | |
166 | ||
167 | local plrs = game:GetService("Players") | |
168 | local plr = plrs.LocalPlayer | |
169 | local char = plr.Character | |
170 | local tweenserv = game:GetService("TweenService") | |
171 | local lighting = game:GetService("Lighting") | |
172 | local hum = char:FindFirstChildOfClass("Humanoid") | |
173 | local mou = plr:GetMouse() | |
174 | local tor = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") | |
175 | local root = char:FindFirstChild("HumanoidRootPart") | |
176 | local head = char:FindFirstChild("Head") | |
177 | local face = head:FindFirstChildOfClass("Decal") | |
178 | local larm = char:FindFirstChild("Left Arm") or char:FindFirstChild("LeftUpperArm") | |
179 | local rarm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightUpperArm") | |
180 | local rleg = char:FindFirstChild("Right Leg") or char:FindFirstChild("RightUpperLeg") | |
181 | local lleg = char:FindFirstChild("Left Leg") or char:FindFirstChild("LeftUpperLeg") | |
182 | local neck = tor:FindFirstChild("Neck") | |
183 | local rootj = root:FindFirstChild("RootJoint") | |
184 | local LS = tor:FindFirstChild("Left Shoulder") | |
185 | local RS = tor:FindFirstChild("Right Shoulder") | |
186 | local LH = tor:FindFirstChild("Left Hip") | |
187 | local RH = tor:FindFirstChild("Right Hip") | |
188 | local bp = plr:FindFirstChild("Backpack") | |
189 | ||
190 | hum:ClearAllChildren() | |
191 | char.Animate:remove() | |
192 | ||
193 | ||
194 | --Converted with ttyyuu12345's model to script plugin v4 | |
195 | function sandbox(var,func) | |
196 | local env = getfenv(func) | |
197 | local newenv = setmetatable({},{ | |
198 | __index = function(self,k) | |
199 | if k=="script" then | |
200 | return var | |
201 | else | |
202 | return env[k] | |
203 | end | |
204 | end, | |
205 | }) | |
206 | setfenv(func,newenv) | |
207 | return func | |
208 | end | |
209 | cors = {} | |
210 | mas = Instance.new("Model",game:GetService("Lighting")) | |
211 | Model0 = Instance.new("Model") | |
212 | Part1 = Instance.new("Part") | |
213 | Part2 = Instance.new("Part") | |
214 | ManualWeld3 = Instance.new("ManualWeld") | |
215 | Part4 = Instance.new("Part") | |
216 | ManualWeld5 = Instance.new("ManualWeld") | |
217 | Part6 = Instance.new("Part") | |
218 | ManualWeld7 = Instance.new("ManualWeld") | |
219 | Part8 = Instance.new("Part") | |
220 | ManualWeld9 = Instance.new("ManualWeld") | |
221 | Part10 = Instance.new("Part") | |
222 | ManualWeld11 = Instance.new("ManualWeld") | |
223 | Part12 = Instance.new("Part") | |
224 | ManualWeld13 = Instance.new("ManualWeld") | |
225 | Model0.Name = "pen" | |
226 | Model0.Parent = mas | |
227 | Part1.Name = "handler2" | |
228 | Part1.Parent = Model0 | |
229 | Part1.Material = Enum.Material.Glass | |
230 | Part1.BrickColor = BrickColor.new("Really black") | |
231 | Part1.Shape = Enum.PartType.Cylinder | |
232 | Part1.Size = Vector3.new(0.099999927, 0.075000003, 0.075000003) | |
233 | Part1.CFrame = CFrame.new(0.422837317, 4.01673937, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
234 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
235 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
236 | Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
237 | Part1.Position = Vector3.new(0.422837317, 4.01673937, 24.1206856) | |
238 | Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
239 | Part2.Name = "handler1" | |
240 | Part2.Parent = Model0 | |
241 | Part2.Material = Enum.Material.Glass | |
242 | Part2.BrickColor = BrickColor.new("Really black") | |
243 | Part2.Shape = Enum.PartType.Cylinder | |
244 | Part2.Size = Vector3.new(0.099999927, 0.100000001, 0.100000001) | |
245 | Part2.CFrame = CFrame.new(0.356837302, 4.02223921, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
246 | Part2.BottomSurface = Enum.SurfaceType.Smooth | |
247 | Part2.TopSurface = Enum.SurfaceType.Smooth | |
248 | Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
249 | Part2.Position = Vector3.new(0.356837302, 4.02223921, 24.1206856) | |
250 | Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
251 | ManualWeld3.Name = "Weld" | |
252 | ManualWeld3.Parent = Part2 | |
253 | ManualWeld3.C1 = CFrame.new(-0.0660000145, 0.00549983978, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
254 | ManualWeld3.Part0 = Part2 | |
255 | ManualWeld3.Part1 = Part1 | |
256 | Part4.Name = "body" | |
257 | Part4.Parent = Model0 | |
258 | Part4.Material = Enum.Material.Glass | |
259 | Part4.BrickColor = BrickColor.new("Really black") | |
260 | Part4.Shape = Enum.PartType.Cylinder | |
261 | Part4.Size = Vector3.new(1.27499998, 0.125, 0.125) | |
262 | Part4.CFrame = CFrame.new(-0.320662677, 4.02673912, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
263 | Part4.BottomSurface = Enum.SurfaceType.Smooth | |
264 | Part4.TopSurface = Enum.SurfaceType.Smooth | |
265 | Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
266 | Part4.Position = Vector3.new(-0.320662677, 4.02673912, 24.1206856) | |
267 | Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
268 | ManualWeld5.Name = "Weld" | |
269 | ManualWeld5.Parent = Part4 | |
270 | ManualWeld5.C1 = CFrame.new(-0.743499994, 0.00999975204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
271 | ManualWeld5.Part0 = Part4 | |
272 | ManualWeld5.Part1 = Part1 | |
273 | Part6.Name = "clipholder" | |
274 | Part6.Parent = Model0 | |
275 | Part6.Material = Enum.Material.Glass | |
276 | Part6.BrickColor = BrickColor.new("Really black") | |
277 | Part6.Shape = Enum.PartType.Cylinder | |
278 | Part6.Size = Vector3.new(0.2, 0.150000006, 0.150000006) | |
279 | Part6.CFrame = CFrame.new(-0.986662686, 4.02623892, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
280 | Part6.BottomSurface = Enum.SurfaceType.Smooth | |
281 | Part6.TopSurface = Enum.SurfaceType.Smooth | |
282 | Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
283 | Part6.Position = Vector3.new(-0.986662686, 4.02623892, 24.1206856) | |
284 | Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
285 | ManualWeld7.Name = "Weld" | |
286 | ManualWeld7.Parent = Part6 | |
287 | ManualWeld7.C1 = CFrame.new(-1.4095, 0.00949954987, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
288 | ManualWeld7.Part0 = Part6 | |
289 | ManualWeld7.Part1 = Part1 | |
290 | Part8.Name = "clip" | |
291 | Part8.Parent = Model0 | |
292 | Part8.Material = Enum.Material.Glass | |
293 | Part8.BrickColor = BrickColor.new("Really black") | |
294 | Part8.Size = Vector3.new(0.724999905, 0.0500000119, 0.100000001) | |
295 | Part8.CFrame = CFrame.new(-0.663956106, 4.10453987, 24.1179676, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
296 | Part8.BottomSurface = Enum.SurfaceType.Smooth | |
297 | Part8.TopSurface = Enum.SurfaceType.Smooth | |
298 | Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
299 | Part8.Position = Vector3.new(-0.663956106, 4.10453987, 24.1179676) | |
300 | Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
301 | ManualWeld9.Name = "Weld" | |
302 | ManualWeld9.Parent = Part8 | |
303 | ManualWeld9.C1 = CFrame.new(-1.08679342, 0.0878005028, -0.0027179718, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
304 | ManualWeld9.Part0 = Part8 | |
305 | ManualWeld9.Part1 = Part1 | |
306 | Part10.Name = "button" | |
307 | Part10.Parent = Model0 | |
308 | Part10.Material = Enum.Material.Glass | |
309 | Part10.BrickColor = BrickColor.new("Dark indigo") | |
310 | Part10.Shape = Enum.PartType.Cylinder | |
311 | Part10.Size = Vector3.new(0.14, 0.125, 0.125) | |
312 | Part10.CFrame = CFrame.new(-1.09316278, 4.02473927, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
313 | Part10.BottomSurface = Enum.SurfaceType.Smooth | |
314 | Part10.TopSurface = Enum.SurfaceType.Smooth | |
315 | Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569) | |
316 | Part10.Position = Vector3.new(-1.09316278, 4.02473927, 24.1206856) | |
317 | Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569) | |
318 | ManualWeld11.Name = "Weld" | |
319 | ManualWeld11.Parent = Part10 | |
320 | ManualWeld11.C1 = CFrame.new(-1.51600003, 0.007999897, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
321 | ManualWeld11.Part0 = Part10 | |
322 | ManualWeld11.Part1 = Part1 | |
323 | Part12.Name = "sharp" | |
324 | Part12.Parent = Model0 | |
325 | Part12.Material = Enum.Material.Glass | |
326 | Part12.Shape = Enum.PartType.Cylinder | |
327 | Part12.Size = Vector3.new(0.099999927, 0.0500000007, 0.0500000007) | |
328 | Part12.CFrame = CFrame.new(0.484837323, 4.01723957, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
329 | Part12.BottomSurface = Enum.SurfaceType.Smooth | |
330 | Part12.TopSurface = Enum.SurfaceType.Smooth | |
331 | Part12.Position = Vector3.new(0.484837323, 4.01723957, 24.1206856) | |
332 | ManualWeld13.Name = "Weld" | |
333 | ManualWeld13.Parent = Part12 | |
334 | ManualWeld13.C1 = CFrame.new(0.0620000064, 0.000500202179, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
335 | ManualWeld13.Part0 = Part12 | |
336 | ManualWeld13.Part1 = Part1 | |
337 | for i,v in pairs(mas:GetChildren()) do | |
338 | v.Parent = char | |
339 | pen = v | |
340 | body = Part4 | |
341 | button = Part10 | |
342 | pcall(function() v:MakeJoints() end) | |
343 | end | |
344 | mas:Destroy() | |
345 | for i,v in pairs(cors) do | |
346 | spawn(function() | |
347 | pcall(v) | |
348 | end) | |
349 | end | |
350 | ||
351 | local rootj0 = rootj.C0 | |
352 | local neck0 = neck.C0 | |
353 | local LS0 = LS.C0 | |
354 | local RS0 = RS.C0 | |
355 | local LH0 = LH.C0 | |
356 | local RH0 = RH.C0 | |
357 | local rootj1 = rootj.C1 | |
358 | local neck1 = neck.C1 | |
359 | local LS1 = LS.C1 | |
360 | local RS1 = RS.C1 | |
361 | local LH1 = LH.C1 | |
362 | local RH1 = RH.C1 | |
363 | ||
364 | ----------------------------------------------------------------------------------- | |
365 | ||
366 | local CFn = CFrame.new | |
367 | local CFa = CFrame.Angles | |
368 | local Rad = math.rad | |
369 | local Sin = math.sin | |
370 | local Cos = math.cos | |
371 | local sine = 1 | |
372 | ||
373 | local penp = Instance.new("Part", char) | |
374 | penp.Size = Vector3.new(1, 1, 1) | |
375 | penp.CanCollide = false | |
376 | penp.Transparency = 1 | |
377 | local penpw = Instance.new("Weld", penp) | |
378 | penpw.Part0 = rarm | |
379 | penpw.Part1 = penp | |
380 | penpw.C1 = CFn(0, -1, 0) * CFa(0, 0, Rad(180)) | |
381 | local penpw0 = penpw.C0 | |
382 | local penpw1 = penpw.C1 | |
383 | ||
384 | local penw = Instance.new("Weld", body) | |
385 | penw.Name = "penWeld22" | |
386 | penw.Part0 = penp | |
387 | penw.Part1 = body | |
388 | penw.C1 = CFa(0, 0, Rad(180)) | |
389 | local penw0 = penw.C0 | |
390 | local penw1 = penw.C1 | |
391 | ||
392 | local sharpw = ManualWeld13 | |
393 | local sharpw0 = ManualWeld13.C0 | |
394 | local sharpw1 = ManualWeld13.C1 | |
395 | local sharpw02 = CFn(0.3, 0, 0) | |
396 | sharpw.C0 = sharpw02 | |
397 | ||
398 | local botw = ManualWeld11 | |
399 | local botw0 = ManualWeld11.C0 | |
400 | local botw1 = ManualWeld11.C1 | |
401 | local botw02 = CFn(-0.07, 0, 0) | |
402 | botw.C0 = botw0 | |
403 | ||
404 | ----------------------------------------------------------------------------------- | |
405 | ||
406 | local ws = 16 | |
407 | local jp = 50 | |
408 | local out = false | |
409 | local ouch = false | |
410 | local hitok = false | |
411 | local canattack = true | |
412 | local stabstate = 1 | |
413 | local Stabbing = false | |
414 | local Throwing = false | |
415 | local rot = 1 | |
416 | local dmg = 5 | |
417 | ||
418 | ----------------------------------------------------------------------------------- | |
419 | ||
420 | ArtificialHB = Instance.new("BindableEvent", script) | |
421 | ArtificialHB.Name = "Heartbeat" | |
422 | script:WaitForChild("Heartbeat") | |
423 | ||
424 | frame = 1 / 60 | |
425 | tf = 0 | |
426 | allowframeloss = false | |
427 | tossremainder = false | |
428 | ||
429 | ||
430 | lastframe = tick() | |
431 | script.Heartbeat:Fire() | |
432 | ||
433 | ||
434 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
435 | tf = tf + s | |
436 | if tf >= frame then | |
437 | if allowframeloss then | |
438 | script.Heartbeat:Fire() | |
439 | lastframe = tick() | |
440 | else | |
441 | for i = 1, math.floor(tf / frame) do | |
442 | script.Heartbeat:Fire() | |
443 | end | |
444 | lastframe = tick() | |
445 | end | |
446 | if tossremainder then | |
447 | tf = 0 | |
448 | else | |
449 | tf = tf - frame * math.floor(tf / frame) | |
450 | end | |
451 | end | |
452 | end) | |
453 | ||
454 | function swait(num) | |
455 | if num == 0 or num == nil then | |
456 | game:service("RunService").Stepped:wait(0) | |
457 | else | |
458 | for i = 0, num do | |
459 | game:service("RunService").Stepped:wait(0) | |
460 | end | |
461 | end | |
462 | end | |
463 | ||
464 | function clerp(a, b, t) | |
465 | return a:lerp(b, t) | |
466 | end | |
467 | ||
468 | function ToggleSharp() | |
469 | if not button:FindFirstChild("Penclickit360") then | |
470 | local clickso = Instance.new("Sound", button) | |
471 | clickso.SoundId = "rbxassetid://537744814" | |
472 | clickso.Name = "Penclickit360" | |
473 | clickso.Volume = 5 | |
474 | clickso:Play() | |
475 | else | |
476 | local clickso = button:FindFirstChild("Penclickit360") | |
477 | clickso:Play() | |
478 | end | |
479 | if out == false then | |
480 | sharpw.C0 = sharpw0 | |
481 | botw.C0 = botw02 | |
482 | dmg = 30 | |
483 | out = true | |
484 | else | |
485 | sharpw.C0 = sharpw02 | |
486 | botw.C0 = botw0 | |
487 | dmg = 5 | |
488 | out = false | |
489 | end | |
490 | end | |
491 | ||
492 | function Stab() | |
493 | if stabstate == 1 and canattack == true then | |
494 | Stabbing = true | |
495 | canattack = false | |
496 | stabstate = 2 | |
497 | hum.WalkSpeed = 3 | |
498 | hum.JumpPower = 7 | |
499 | hitok = true | |
500 | body.Touched:connect(function(hit) | |
501 | if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then | |
502 | hitok = false | |
503 | local owdude = hit.Parent | |
504 | local owhum = owdude:FindFirstChildOfClass("Humanoid") | |
505 | owhum.Health = owhum.Health - dmg | |
506 | if out == true then | |
507 | local bloodsound = Instance.new("Sound", hit) | |
508 | bloodsound.Volume = 10 | |
509 | bloodsound.SoundId = "rbxassetid://180083298" | |
510 | bloodsound:Play() | |
511 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
512 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
513 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
514 | bloodsplash.Speed = NumberRange.new(6) | |
515 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
516 | bloodsplash.Rate = 1000 | |
517 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
518 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
519 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
520 | bloodsplash.Texture = "rbxassetid://771221224" | |
521 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
522 | wait(0.25) | |
523 | bloodsplash.Enabled = false | |
524 | end | |
525 | end | |
526 | if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then | |
527 | hitok = false | |
528 | local owdude = hit.Parent.Parent | |
529 | local owhum = owdude:FindFirstChildOfClass("Humanoid") | |
530 | owhum.Health = owhum.Health - dmg | |
531 | if out == true then | |
532 | local bloodsound = Instance.new("Sound", hit) | |
533 | bloodsound.Volume = 10 | |
534 | bloodsound.SoundId = "rbxassetid://180083298" | |
535 | bloodsound:Play() | |
536 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
537 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
538 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
539 | bloodsplash.Speed = NumberRange.new(6) | |
540 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
541 | bloodsplash.Rate = 1000 | |
542 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
543 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
544 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
545 | bloodsplash.Texture = "rbxassetid://771221224" | |
546 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
547 | wait(0.25) | |
548 | bloodsplash.Enabled = false | |
549 | end | |
550 | end | |
551 | end) | |
552 | for i = 0,1,.15 do | |
553 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i) | |
554 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
555 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i) | |
556 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
557 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-30), Rad(-30), Rad(-3)), i) | |
558 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i) | |
559 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i) | |
560 | LS.C0 = clerp(LS.C0, LS0, i) | |
561 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i) | |
562 | LH.C0 = clerp(LH.C0, LH0, i) | |
563 | RH.C0 = clerp(RH.C0, RH0, i) | |
564 | swait() | |
565 | end | |
566 | for i = 0,1,.15 do | |
567 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i) | |
568 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
569 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i) | |
570 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
571 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(20), Rad(-30), Rad(-3)), i) | |
572 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i) | |
573 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i) | |
574 | LS.C0 = clerp(LS.C0, LS0, i) | |
575 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i) | |
576 | LH.C0 = clerp(LH.C0, LH0, i) | |
577 | RH.C0 = clerp(RH.C0, RH0, i) | |
578 | swait() | |
579 | end | |
580 | hitok = false | |
581 | hum.WalkSpeed = ws | |
582 | hum.JumpPower = jp | |
583 | canattack = true | |
584 | Stabbing = false | |
585 | elseif stabstate == 2 and canattack == true then | |
586 | canattack = false | |
587 | stabstate = 1 | |
588 | hum.WalkSpeed = 3 | |
589 | hum.JumpPower = 7 | |
590 | hitok = true | |
591 | body.Touched:connect(function(hit) | |
592 | if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then | |
593 | local owdude = hit.Parent | |
594 | local owhum = owdude:FindFirstChildOfClass("Humanoid") | |
595 | owhum.Health = owhum.Health - dmg | |
596 | if out == true then | |
597 | local bloodsound = Instance.new("Sound", hit) | |
598 | bloodsound.Volume = 10 | |
599 | bloodsound.SoundId = "rbxassetid://180083298" | |
600 | bloodsound:Play() | |
601 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
602 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
603 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
604 | bloodsplash.Speed = NumberRange.new(6) | |
605 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
606 | bloodsplash.Rate = 1000 | |
607 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
608 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
609 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
610 | bloodsplash.Texture = "rbxassetid://771221224" | |
611 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
612 | wait(0.25) | |
613 | bloodsplash.Enabled = false | |
614 | end | |
615 | end | |
616 | if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then | |
617 | hitok = false | |
618 | local owdude = hit.Parent.Parent | |
619 | local owhum = owdude:FindFirstChildOfClass("Humanoid") | |
620 | owhum.Health = owhum.Health - dmg | |
621 | if out == true then | |
622 | local bloodsound = Instance.new("Sound", hit) | |
623 | bloodsound.Volume = 10 | |
624 | bloodsound.SoundId = "rbxassetid://180083298" | |
625 | bloodsound:Play() | |
626 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
627 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
628 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
629 | bloodsplash.Speed = NumberRange.new(6) | |
630 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
631 | bloodsplash.Rate = 1000 | |
632 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
633 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
634 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
635 | bloodsplash.Texture = "rbxassetid://771221224" | |
636 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
637 | wait(0.25) | |
638 | bloodsplash.Enabled = false | |
639 | end | |
640 | end | |
641 | end) | |
642 | for i = 0,1,.15 do | |
643 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i) | |
644 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
645 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i) | |
646 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
647 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(30), Rad(-3)), i) | |
648 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i) | |
649 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i) | |
650 | LS.C0 = clerp(LS.C0, LS0, i) | |
651 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i) | |
652 | LH.C0 = clerp(LH.C0, LH0, i) | |
653 | RH.C0 = clerp(RH.C0, RH0, i) | |
654 | swait() | |
655 | end | |
656 | for i = 0,1,.15 do | |
657 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i) | |
658 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
659 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i) | |
660 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
661 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-20), Rad(30), Rad(-3)), i) | |
662 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i) | |
663 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i) | |
664 | LS.C0 = clerp(LS.C0, LS0, i) | |
665 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i) | |
666 | LH.C0 = clerp(LH.C0, LH0, i) | |
667 | RH.C0 = clerp(RH.C0, RH0, i) | |
668 | swait() | |
669 | end | |
670 | hitok = false | |
671 | hum.WalkSpeed = ws | |
672 | hum.JumpPower = jp | |
673 | canattack = true | |
674 | Stabbing = false | |
675 | end | |
676 | end | |
677 | ||
678 | function Throw() | |
679 | if canattack == true then | |
680 | Throwing = true | |
681 | canattack = false | |
682 | hum.WalkSpeed = 3 | |
683 | hum.JumpPower = 7 | |
684 | ouch = true | |
685 | for i = 0,1,.15 do | |
686 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i) | |
687 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
688 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i) | |
689 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
690 | RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i) | |
691 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i) | |
692 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i) | |
693 | LS.C0 = clerp(LS.C0, LS0, i) | |
694 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(90), Rad(90)), i) | |
695 | LH.C0 = clerp(LH.C0, LH0, i) | |
696 | RH.C0 = clerp(RH.C0, RH0, i) | |
697 | swait() | |
698 | end | |
699 | local throwpen = pen:Clone() | |
700 | for i,v in pairs(throwpen:GetChildren()) do | |
701 | if v:IsA("BasePart") and v.CanCollide == true then | |
702 | v.CanCollide = false | |
703 | end | |
704 | end | |
705 | throwpen.Parent = workspace | |
706 | local throwbod = throwpen:FindFirstChild("body") | |
707 | if throwbod:FindFirstChild("penWeld22") then | |
708 | throwbod:FindFirstChild("penWeld22"):Destroy() | |
709 | end | |
710 | local throwbv = Instance.new("BodyVelocity", throwbod) | |
711 | throwbv.Velocity = mou.Hit.lookVector * 100 | |
712 | throwbv.MaxForce = Vector3.new(100000000000000000, 100000000000000000, 100000000000000000) | |
713 | throwbod.Touched:connect(function(hit) | |
714 | if ouch == true and not hit:IsDescendantOf(char) then | |
715 | ouch = false | |
716 | throwpen:Destroy() | |
717 | if hit.Parent:FindFirstChildOfClass("Humanoid") then | |
718 | local throwhum = hit.Parent:FindFirstChildOfClass("Humanoid") | |
719 | throwhum.Health = throwhum.Health - dmg | |
720 | if out == true then | |
721 | local bloodsound = Instance.new("Sound", hit) | |
722 | bloodsound.Volume = 10 | |
723 | bloodsound.SoundId = "rbxassetid://180083286" | |
724 | bloodsound:Play() | |
725 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
726 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
727 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
728 | bloodsplash.Speed = NumberRange.new(6) | |
729 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
730 | bloodsplash.Rate = 1000 | |
731 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
732 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
733 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
734 | bloodsplash.Texture = "rbxassetid://771221224" | |
735 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
736 | wait(0.25) | |
737 | bloodsplash.Enabled = false | |
738 | end | |
739 | end | |
740 | if hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then | |
741 | local throwhum = hit.Parent.Parent:FindFirstChildOfClass("Humanoid") | |
742 | throwhum.Health = throwhum.Health - dmg | |
743 | if out == true then | |
744 | local bloodsound = Instance.new("Sound", hit) | |
745 | bloodsound.Volume = 10 | |
746 | bloodsound.SoundId = "rbxassetid://180083286" | |
747 | bloodsound:Play() | |
748 | game:GetService("Debris"):AddItem(bloodsound, 1) | |
749 | local bloodsplash = Instance.new("ParticleEmitter", hit) | |
750 | bloodsplash.Lifetime = NumberRange.new(0.7, 1) | |
751 | bloodsplash.Speed = NumberRange.new(6) | |
752 | bloodsplash.SpreadAngle = Vector2.new(-360, 360) | |
753 | bloodsplash.Rate = 1000 | |
754 | bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)}) | |
755 | bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)}) | |
756 | bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))}) | |
757 | bloodsplash.Texture = "rbxassetid://771221224" | |
758 | game:GetService("Debris"):AddItem(bloodsplash, 1) | |
759 | wait(0.25) | |
760 | bloodsplash.Enabled = false | |
761 | end | |
762 | end | |
763 | end | |
764 | end) | |
765 | for i,v in pairs(pen:GetChildren()) do | |
766 | if v:IsA("BasePart") then | |
767 | v.Transparency = 1 | |
768 | end | |
769 | end | |
770 | for i = 0,1,.1 do | |
771 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i) | |
772 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i) | |
773 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(Rad(-20), 0, 0), i) | |
774 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
775 | RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i) | |
776 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), Rad(-20)), i) | |
777 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), Rad(-20)), i) | |
778 | LS.C0 = clerp(LS.C0, LS0, i) | |
779 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(-80), Rad(90)), i) | |
780 | LH.C0 = clerp(LH.C0, LH0, i) | |
781 | RH.C0 = clerp(RH.C0, RH0, i) | |
782 | swait() | |
783 | end | |
784 | for i = 0,1,.1 do | |
785 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i) | |
786 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-30), 0, 0), i) | |
787 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(0, 0, Rad(-30)), i) | |
788 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i) | |
789 | RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i) | |
790 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i) | |
791 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i) | |
792 | LS.C0 = clerp(LS.C0, LS0, i) | |
793 | RS.C0 = clerp(RS.C0, RS0 * CFn(0, 0, -0.5) * CFa(0, Rad(90), Rad(30)), i) | |
794 | LH.C0 = clerp(LH.C0, LH0, i) | |
795 | RH.C0 = clerp(RH.C0, RH0, i) | |
796 | swait() | |
797 | end | |
798 | for i,v in pairs(pen:GetChildren()) do | |
799 | if v:IsA("BasePart") then | |
800 | v.Transparency = 0 | |
801 | end | |
802 | end | |
803 | hum.WalkSpeed = ws | |
804 | hum.JumpPower = jp | |
805 | canattack = true | |
806 | Throwing = false | |
807 | end | |
808 | end | |
809 | ||
810 | ----------------------------------------------------------------------------------- | |
811 | ||
812 | function kdown(k) | |
813 | if k == "e" then | |
814 | ToggleSharp() | |
815 | elseif k == "f" then | |
816 | Throw() | |
817 | end | |
818 | end | |
819 | ||
820 | mou.KeyDown:connect(kdown) | |
821 | mou.Button1Down:connect(Stab) | |
822 | ||
823 | ----------------------------------------------------------------------------------- | |
824 | ||
825 | while true do | |
826 | swait() | |
827 | sine = sine + 1 | |
828 | rot = rot + 25 | |
829 | if rot == 360 then | |
830 | rot = 1 | |
831 | end | |
832 | local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude | |
833 | if Stabbing == true then | |
834 | state = "Stabbing" | |
835 | elseif Throwing == true then | |
836 | state = "Throwing" | |
837 | elseif 1 < root.Velocity.y then | |
838 | state = "Jump" | |
839 | elseif -1 > root.Velocity.y then | |
840 | state = "Fall" | |
841 | elseif torvel < 1 then | |
842 | state = "Idle" | |
843 | elseif tor.Velocity.magnitude < 50 then | |
844 | state = "Walk" | |
845 | end | |
846 | if state == "Jump" then | |
847 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15) | |
848 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), 0.15) | |
849 | rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(-15), 0, 0), 0.15) | |
850 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), 0.15) | |
851 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(10), 0, 0), 0.15) | |
852 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.2, 0) * CFa(Rad(2), 0, Rad(-15)), 0.15) | |
853 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.5, 0) * CFa(Rad(2), 0, Rad(15)), 0.15) | |
854 | LS.C0 = clerp(LS.C0, LS0, 0.15) | |
855 | RS.C0 = clerp(RS.C0, RS0, 0.15) | |
856 | LH.C0 = clerp(LH.C0, LH0 * CFn(-0.2, 0, 0), 0.15) | |
857 | RH.C0 = clerp(RH.C0, RH0 * CFn(0.5, 0, 0), 0.15) | |
858 | elseif state == "Fall" then | |
859 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15) | |
860 | neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, 0), 0.15) | |
861 | rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(15), 0, 0), 0.15) | |
862 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(35), 0, 0), 0.15) | |
863 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(35), 0, 0), 0.15) | |
864 | LH.C1 = clerp(LH.C1, LH1 * CFn(0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(10)), 0.15) | |
865 | RH.C1 = clerp(RH.C1, RH1 * CFn(-0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(-10)), 0.15) | |
866 | LS.C0 = clerp(LS.C0, LS0, 0.15) | |
867 | RS.C0 = clerp(RS.C0, RS0, 0.15) | |
868 | LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(-20)), 0.15) | |
869 | RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(20)), 0.15) | |
870 | elseif state == "Idle" then | |
871 | penw.C1 = clerp(penw.C1, penw1 * CFn(0, 0, 0.5) * CFa(0, 0, Rad(rot)), 0.15) | |
872 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2 * Cos(sine / 15)), 0, 0), 0.15) | |
873 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025 * Cos(sine / 15)), 0.15) | |
874 | LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), 0.15) | |
875 | RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(2), 0, Rad(-3 * Cos(sine / 15))), 0.15) | |
876 | LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(-5), 0), 0.15) | |
877 | RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(5), 0), 0.15) | |
878 | LS.C0 = clerp(LS.C0, LS0, 0.15) | |
879 | RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(80)), 0.15) | |
880 | LH.C0 = clerp(LH.C0, LH0, 0.15) | |
881 | RH.C0 = clerp(RH.C0, RH0, 0.15) | |
882 | elseif state == "Walk" then | |
883 | penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15) | |
884 | neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5), 0, 0), 0.15) | |
885 | rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0.1 * Cos(sine /3), 0.1 * Cos(sine /3)) * CFa(Rad(-5), 0, Rad(5 * Cos(sine / 6))), 0.15) | |
886 | LS.C1 = clerp(LS.C1, LS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15) | |
887 | RS.C1 = clerp(RS.C1, RS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15) | |
888 | LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(2), Rad(-5), Rad(50 * Cos(sine / 6))), 0.15) | |
889 | RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(2), Rad(5), Rad(50 * Cos(sine / 6))), 0.15) | |
890 | LS.C0 = clerp(LS.C0, LS0, 0.15) | |
891 | RS.C0 = clerp(RS.C0, RS0, 0.15) | |
892 | LH.C0 = clerp(LH.C0, LH0, 0.15) | |
893 | RH.C0 = clerp(RH.C0, RH0, 0.15) | |
894 | end | |
895 | end |