View difference between Paste ID: xB1iupZB and yb87CMdE
SHOW: | | - or go back to the newest paste.
1-
1+
2
if not Shared or game.Players.LocalPlayer.benja0009 == Shared then
3-
if not Shared or game.Players.LocalPlayer.Name == Shared then
3+
4
pcall(function()
5
    game.Players.LocalPlayer.Character.Animate.Disabled = true
6
end)
7
local active = true
8
local player = game.Players.LocalPlayer
9
local mouse = player:GetMouse()
10
local stats = {
11
    ["Power"] = 10,
12
    ["HP"] = math.huge,
13
    ["HPRegen"] = math.huge,
14
    ["MP"] = math.huge,
15
    ["MPRegen"] = 10,
16
    ["MPCharge"] = 20,
17
    ["WalkSpeed"] = 16
18
}
19
local state = {}
20
local c0 = {
21
    ["Neck"] = {Vector3.new(0,1.5,0),CFrame.Angles(math.pi/-2,0,0)},
22
    ["Right Shoulder"] = {Vector3.new(1.5,0.5,0),CFrame.Angles(0,math.pi/2,0)},
23
    ["Left Shoulder"] = {Vector3.new(-1.5,0.5,0),CFrame.Angles(0,math.pi/-2,0)},
24
    ["Right Hip"] = {Vector3.new(0.5,-1,0),CFrame.Angles(0,math.pi/2,0)},
25
    ["Left Hip"] = {Vector3.new(-0.5,-1,0),CFrame.Angles(0,math.pi/-2,0)}
26
}
27
local c1 = {
28
    ["Neck"] = CFrame.Angles(math.pi/-2,0,0),
29
    ["Right Shoulder"] = CFrame.new(0,0.5,0)*CFrame.Angles(0,math.pi/2,0),
30
    ["Left Shoulder"] = CFrame.new(0,0.5,0)*CFrame.Angles(0,math.pi/-2,0),
31
    ["Right Hip"] = CFrame.new(0,1,0)*CFrame.Angles(0,math.pi/2,0),
32
    ["Left Hip"] = CFrame.new(0,1,0)*CFrame.Angles(0,math.pi/-2,0)
33
}
34
local bodyPart = {}
35
local limb = {}
36
local humanoidState = {}
37
local humanoidCurrentState = "Standing"
38
for _,v in pairs({"Climbing","FallingDown","FreeFalling","GettingUp","Jumping","Ragdoll","Running","Seated","Strafing","Swimming"}) do
39
    local number = {"Running","Strafing","Climbing","Swimming"}
40
    for _,p in pairs(number) do number[p] = true end
41
    humanoidState[v] = {
42
    ["Connection"] = nil,
43
    ["Value"] = number[v] and 0 or false}
44
end
45
local humanoid
46
local bpos
47
local gyro
48
local bvel
49
local ui
50
local skillName = {
51
    ["z"] = "Iron Fist",
52
    ["x"] = "Crushing Fang",
53
    ["c"] = "Flame Elbow",
54
    ["v"] = "Claw",
55
        ["g"] = "FireBreath",
56
        ["f"] = "Eagle",
57
    ["b"] = "Roar",
58
    ["n"] = "Wing Attack",
59
    ["m"] = "Sword Horn"
60
}
61
local skillFunc = {
62
    ["Iron Fist"] = function()
63
        local cam = workspace.CurrentCamera
64
        local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
65
        local strength = state.MPCharge*stats.Power
66
        for i=1,5 do
67
            wait(1/30)
68
            gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
69
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
70
            bodyPart.Torso.Velocity = Vector3.new()
71
            translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
72
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
73
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/1.5),Vector3.new(0.25,0,-0.25),0.75)
74
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
75
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
76
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
77
        end
78
        for i=1,5 do
79
            wait(1/30)
80
            local ratio = i/5
81
            gyro.cframe = target*CFrame.Angles(-math.pi/3,math.pi/2,0)
82
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2*(1-ratio)
83
            bodyPart.Torso.Velocity = Vector3.new()
84
            translateLimb("Neck",Vector3.new(),Vector3.new(),0.75)
85
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/5,math.pi/1.5),Vector3.new(-0.5,0,-0.5),0.75)
86
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/24),Vector3.new(),0.75)
87
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.5,-0.5),0.75)
88
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
89
            AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
90
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
91
        end
92
    end,
93
    ["Crushing Fang"] = function()
94
        local cam = workspace.CurrentCamera
95
        local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
96
        local strength = state.MPCharge*stats.Power
97
        for i=1,5 do
98
            wait(1/30)
99
            local ratio = math.min(1,i/3)
100
            gyro.cframe = target*CFrame.Angles(math.pi/6*ratio,0,math.pi/3*ratio)
101
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector
102
            bodyPart.Torso.Velocity = Vector3.new()
103
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
104
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(0.25,0,-0.25),0.75)
105
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(0,0.5,-0.25),0.75)
106
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
107
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
108
        end
109
        for i=1,5 do
110
            wait(1/30)
111
            local ratio = math.min(1,i/3)
112
            gyro.cframe = target*CFrame.Angles(math.pi/6-(math.pi+math.pi/6)*ratio,0,math.pi/3)
113
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*(1-ratio)
114
            bodyPart.Torso.Velocity = Vector3.new()
115
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/8,math.pi/2),Vector3.new(),0.75)
116
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(0.25,0,-0.25),0.75)
117
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(0,0.5,-0.25),0.75)
118
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
119
            AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/50,target.lookVector*strength/500,true)
120
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
121
        end
122
    end,
123
    ["Flame Elbow"] = function()
124
        local cam = workspace.CurrentCamera
125
        local cf = bodyPart.Torso.CFrame
126
        local lookXZ = CFrame.new(cf.p,mouse.Hit.p*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
127
        local strength = state.MPCharge*stats.Power
128
        function booster(size)
129
            local dir = bodyPart["Right Arm"].CFrame
130
            local maxSize = math.min(10,math.ceil(size/2))
131
            for i=1,maxSize do
132
                wait(1/30)
133
                local ratio = i/maxSize
134
                local pos = (dir*CFrame.new(0,1+i*math.min(30,math.max(2,size*ratio))/4,0)).p
135
                flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,size*ratio)
136
                AoE(pos,math.max(2,size*ratio),strength/100,(dir*CFrame.Angles(math.pi/2,0,0)).lookVector*strength/1000)
137
            end
138
        end
139
        for i=1,30 do
140
            wait(1/30)
141
            gyro.cframe = lookXZ*CFrame.Angles(0,-math.pi/3,0)
142
            bodyPart.Torso.CFrame = (bodyPart.Torso.CFrame-bodyPart.Torso.CFrame.p)+cf.p
143
            bodyPart.Torso.Velocity = Vector3.new()
144
            translateLimb("Neck",Vector3.new(0,0,math.pi/4),Vector3.new(),0.75)
145
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/2),Vector3.new(-0.25,0,-0.5),0.75)
146
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(),0.75)
147
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
148
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
149
            if i > 3 then
150
                coroutine.wrap(booster)(i)
151
            end
152
        end
153
        for i=1,5 do
154
            wait(0.01)
155
            gyro.cframe = lookXZ*CFrame.Angles(0,math.pi/2,0)
156
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,0,-5*i)*CFrame.Angles(0,math.pi/2,0)
157
            bodyPart.Torso.Velocity = Vector3.new()
158
            translateLimb("Neck",Vector3.new(),Vector3.new(),0.9)
159
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/2,math.pi/2),Vector3.new(),0.9)
160
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/12),Vector3.new(),0.9)
161
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
162
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
163
            AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,2,strength*10,lookXZ.lookVector*strength*100,true)
164
        end
165
    end,
166
    ["Eagle"] = function()
167
        local cam = workspace.CurrentCamera
168
        local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
169
        local strength = state.MPCharge*stats.Power
170
        for i=1,5 do
171
            wait(1/30)
172
            gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
173
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
174
            bodyPart.Torso.Velocity = Vector3.new()
175
            translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
176
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/3,math.pi/2),Vector3.new(),0.75)
177
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/1.5),Vector3.new(0.25,0,-0.25),0.75)
178
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
179
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
180
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
181
        end
182
                for i=1,5 do
183
            wait(1/30)
184
            gyro.cframe = target*CFrame.Angles(-math.pi/3,-math.pi/4,0)
185
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2
186
            bodyPart.Torso.Velocity = Vector3.new()
187
            translateLimb("Neck",Vector3.new(math.pi/6,0,0),Vector3.new(),0.75)
188
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/7,math.pi/1),Vector3.new(),0.75)
189
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/8,-math.pi/3),Vector3.new(0.50,0,-0.30),0.90)
190
            translateLimb("Right Hip",Vector3.new(-math.pi/6,0,-math.pi/6),Vector3.new(0,0.75,-0.20),0.50)
191
            translateLimb("Left Hip",Vector3.new(-math.pi/6,0,-math.pi/12),Vector3.new(),0.50)
192
                        AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
193
        end
194
        for i=1,5 do
195
            wait(1/30)
196
            local ratio = i/5
197
            gyro.cframe = target*CFrame.Angles(-math.pi/3,math.pi/2,0)
198
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*2*(1-ratio)
199
            bodyPart.Torso.Velocity = Vector3.new()
200
            translateLimb("Neck",Vector3.new(),Vector3.new(),0.75)
201
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/5,math.pi/1.5),Vector3.new(-0.5,0,-0.5),0.75)
202
            translateLimb("Left Shoulder",Vector3.new(-math.pi/6,0,math.pi/24),Vector3.new(),0.75)
203
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.5,-0.5),0.75)
204
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
205
                        explosion((bodyPart["Right Arm"]),5,2,0)
206
            AoE((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
207
            flame(CFrame.new((bodyPart["Right Arm"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
208
        end
209
    end,
210
    ["Claw"] = function()
211
        local cam = workspace.CurrentCamera
212
        local target = CFrame.new(bodyPart.Torso.Position,mouse.Hit.p)
213
        local strength = state.MPCharge*stats.Power
214
        for i=1,10 do
215
            wait(1/30)
216
            local hit,pos = advRay(bodyPart.Torso.Position,target.lookVector*5,{player.Character})
217
            gyro.cframe = target*CFrame.Angles(0,math.pi/2,math.pi/3)
218
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+target.lookVector*(bodyPart.Torso.Position-pos).magnitude
219
            bodyPart.Torso.Velocity = Vector3.new()
220
            translateLimb("Neck",Vector3.new(0,math.pi/12,-math.pi/3),Vector3.new(),0.75)
221
            translateLimb("Right Shoulder",Vector3.new(-math.pi/3,0,0),Vector3.new(),0.75)
222
            translateLimb("Left Shoulder",Vector3.new(-math.pi/3,0,0),Vector3.new(0.25,0,-0.25),0.75)
223
            translateLimb("Right Hip",Vector3.new(-math.pi/8,0,0),Vector3.new(),0.75)
224
            translateLimb("Left Hip",Vector3.new(math.pi/8,0,-math.pi/12),Vector3.new(-0.5,0.5,0),0.75)
225
            AoE((bodyPart["Right Leg"].CFrame*CFrame.new(0,-1,0)).p,math.max(2,math.min(5,state.MPCharge)),strength/10,target.lookVector*strength/10,true)
226
            flame(CFrame.new((bodyPart["Right Leg"].CFrame*CFrame.new(0,-1,0)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),state.MP,math.min(5,state.MPCharge))
227
            if hit then
228
                bodyPart.Torso.Velocity = bodyPart.Torso.Velocity+Vector3.new(0,60,0)-target.lookVector*20
229
                break
230
            end
231
        end
232
    end,
233
            ["FireBreath"] = function()
234
        local cam = workspace.CurrentCamera
235
        local mouseHit = mouse.Hit.p
236
        local cf = bodyPart.Torso.CFrame
237
        local lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
238
        local target = (mouseHit-cf.p).unit
239
        local dir = math.pi/2-math.acos(target.y)
240
        local strength = state.MPCharge*stats.Power
241
        for i=1,50 do
242
            wait(1/30)
243
            local ratio = math.sin(i/100*math.pi)
244
            local offset = math.sin(-ratio*math.pi/8)
245
            gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio,0,0)
246
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,offset,-offset)*CFrame.Angles(math.pi/4*ratio,0,0)
247
            bodyPart.Torso.Velocity = Vector3.new()
248
            translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
249
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/12),Vector3.new(),0.5)
250
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/12),Vector3.new(),0.5)
251
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio),Vector3.new(),1)
252
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio),Vector3.new(),1)
253
        end
254
        for i=1,5 do
255
            wait(1/30)
256
            local ratio = 1-i/5
257
            local offset = math.sin(i/5*dir)+math.sin(-ratio*math.pi/8)
258
            local rot = dir*i/5
259
            gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio+rot,0,0)
260
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(math.pi/4*ratio+rot,0,0)
261
            bodyPart.Torso.Velocity = Vector3.new()
262
            translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
263
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
264
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
265
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio-rot),Vector3.new(),1)
266
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio+rot),Vector3.new(),1)
267
        end
268
        --rune(bodyPart.Head.CFrame*CFrame.new(0,0,-3)*CFrame.Angles(math.pi/2,0,0),5,13/3)
269
        for i=1,50 do
270
            wait(1/30)
271
            mouseHit = mouseHit:Lerp(mouse.Hit.p,0.1)
272
            lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
273
            target = (mouseHit-cf.p).unit
274
            dir = math.pi/2-math.acos(target.y)
275
            local offset = math.sin(dir)
276
            gyro.cframe = lookXZ*CFrame.Angles(dir,0,0)
277
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(dir,0,0)
278
            bodyPart.Torso.Velocity = Vector3.new()
279
            translateLimb("Neck",Vector3.new(),Vector3.new(),1)
280
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
281
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
282
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-dir),Vector3.new(),0.5)
283
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,dir),Vector3.new(),0.5)
284
            coroutine.wrap(function()
285
                local direction = bodyPart.Head.CFrame
286
                for n=1,10 do
287
                    wait(1/30)
288
                    local scale = math.min(30,n*3)
289
                    flame(CFrame.new((direction*CFrame.new(0,0,-5-n*scale/4)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,scale)
290
                    AoE((direction*CFrame.new(0,0,-5-n*scale/4)).p,scale,strength/100,target*strength/1000,false)
291
                end
292
            end)()
293
        end
294
    end,
295
    ["Roar"] = function()
296
        local cam = workspace.CurrentCamera
297
        local mouseHit = mouse.Hit.p
298
        local cf = bodyPart.Torso.CFrame
299
        local lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
300
        local target = (mouseHit-cf.p).unit
301
        local dir = math.pi/2-math.acos(target.y)
302
        local strength = state.MPCharge*stats.Power
303
        for i=1,50 do
304
            wait(1/30)
305
            local ratio = math.sin(i/100*math.pi)
306
            local offset = math.sin(-ratio*math.pi/8)
307
            gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio,0,0)
308
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,offset,-offset)*CFrame.Angles(math.pi/4*ratio,0,0)
309
            bodyPart.Torso.Velocity = Vector3.new()
310
            translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
311
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/12),Vector3.new(),0.5)
312
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/12),Vector3.new(),0.5)
313
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio),Vector3.new(),1)
314
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio),Vector3.new(),1)
315
        end
316
        for i=1,5 do
317
            wait(1/30)
318
            local ratio = 1-i/5
319
            local offset = math.sin(i/5*dir)+math.sin(-ratio*math.pi/8)
320
            local rot = dir*i/5
321
            gyro.cframe = lookXZ*CFrame.Angles(math.pi/4*ratio+rot,0,0)
322
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(math.pi/4*ratio+rot,0,0)
323
            bodyPart.Torso.Velocity = Vector3.new()
324
            translateLimb("Neck",Vector3.new(math.pi/12*ratio,0,0),Vector3.new(),1)
325
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
326
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
327
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-math.pi/4*ratio-rot),Vector3.new(),1)
328
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,math.pi/4*ratio+rot),Vector3.new(),1)
329
        end
330
        --rune(bodyPart.Head.CFrame*CFrame.new(0,0,-3)*CFrame.Angles(math.pi/2,0,0),5,13/3)
331
        for i=1,50 do
332
            wait(1/30)
333
            mouseHit = mouseHit:Lerp(mouse.Hit.p,0.1)
334
            lookXZ = CFrame.new(cf.p,mouseHit*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
335
            target = (mouseHit-cf.p).unit
336
            dir = math.pi/2-math.acos(target.y)
337
            local offset = math.sin(dir)
338
            gyro.cframe = lookXZ*CFrame.Angles(dir,0,0)
339
            bodyPart.Torso.CFrame = lookXZ*CFrame.new(0,-math.abs(offset),offset)*CFrame.Angles(dir,0,0)
340
            bodyPart.Torso.Velocity = Vector3.new()
341
            translateLimb("Neck",Vector3.new(),Vector3.new(),1)
342
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(-0.75,0,-0.5),0.5)
343
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/3.5,-math.pi/1.5),Vector3.new(0.75,0,-0.5),0.5)
344
            translateLimb("Right Hip",Vector3.new(-math.pi/24,0,-dir),Vector3.new(),0.5)
345
            translateLimb("Left Hip",Vector3.new(-math.pi/24,0,dir),Vector3.new(),0.5)
346
            coroutine.wrap(function()
347
                local direction = bodyPart.Head.CFrame
348
                for n=1,10 do
349
                    wait(1/30)
350
                    local scale = math.min(30,n*3)
351
                    flame(CFrame.new((direction*CFrame.new(0,0,-5-n*scale/4)).p)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,scale)
352
                    AoE((direction*CFrame.new(0,0,-5-n*scale/4)).p,scale,strength/100,target*strength/1000,false)
353
                end
354
            end)()
355
        end
356
    end,
357
    ["Wing Attack"] = function()
358
        local cam = workspace.CurrentCamera
359
        local cf = bodyPart.Torso.CFrame
360
        local lookXZ = CFrame.new(cf.p,mouse.Hit.p*Vector3.new(1,0,1)+Vector3.new(0,cf.p.y,0))
361
        local target = CFrame.new(cf.p,mouse.Hit.p)
362
        local strength = state.MPCharge*stats.Power
363
        for i=1,5 do
364
            wait(1/30)
365
            gyro.cframe = lookXZ*CFrame.Angles(-math.pi/6,0,0)
366
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3
367
            bodyPart.Torso.Velocity = Vector3.new()
368
            translateLimb("Neck",Vector3.new(math.pi/12,0,0),Vector3.new(),0.75)
369
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/3,math.pi/1.5),Vector3.new(),0.75)
370
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/4,-math.pi/1.5),Vector3.new(),0.75)
371
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/6),Vector3.new(0,0.75,-0.75),0.75)
372
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
373
        end
374
        function wing()
375
            local dir1 = bodyPart["Right Arm"].CFrame
376
            local dir2 = bodyPart["Left Arm"].CFrame
377
            for n=1,10 do
378
                wait(1/30)
379
                if dir1 then
380
                    local hit,pos = advRay(dir1.p,(dir1*CFrame.new(0,-1-n*5,0)).p-dir1.p,{player.Character})
381
                    flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,10,true)
382
                    AoE(pos,hit and 20 or 10,strength/(hit and 1 or 10),(dir1*CFrame.Angles(-math.pi,0,0)).lookVector*strength/10,true)
383
                    if hit then
384
                        local x = Instance.new("Explosion",workspace)
385
                        x.Position = pos
386
                        x.BlastPressure = 0
387
                        x.BlastRadius = 3
388
                        dir1 = nil
389
                    end
390
                end
391
                if dir2 then
392
                    local hit,pos = advRay(dir2.p,(dir2*CFrame.new(0,-1-n*5,0)).p-dir2.p,{player.Character})
393
                    flame(CFrame.new(pos)*CFrame.Angles((math.random()-0.5)*math.pi/4,0,(math.random()-0.5)*math.pi/4),9,10,true)
394
                    AoE(pos,hit and 20 or 10,strength/(hit and 1 or 10),(dir2*CFrame.Angles(-math.pi,0,0)).lookVector*strength/(hit and 1 or 10),true)
395
                    if hit then
396
                        local x = Instance.new("Explosion",workspace)
397
                        x.Position = pos
398
                        x.BlastPressure = 0
399
                        x.BlastRadius = 3
400
                        dir2 = nil
401
                    end
402
                end
403
                if not dir1 and not dir2 then break end
404
            end
405
        end
406
        for i=1,10 do
407
            wait(1/30)
408
            local ratio = i/10
409
            gyro.cframe = lookXZ*CFrame.Angles(-math.pi/6+math.pi/3*ratio,0,0)
410
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3
411
            bodyPart.Torso.Velocity = Vector3.new()
412
            translateLimb("Neck",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.75)
413
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,math.pi*1.25),Vector3.new(),0.5)
414
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,-math.pi*1.25),Vector3.new(),0.5)
415
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
416
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
417
            if i > 3 then
418
                coroutine.wrap(wing)()
419
            end
420
        end
421
        for i=1,10 do
422
            wait(1/30)
423
            gyro.cframe = lookXZ*CFrame.Angles(math.pi/6-(math.pi/3+math.pi/6)*math.min(1,i/3),0,0)
424
            bodyPart.Torso.CFrame = bodyPart.Torso.CFrame+(lookXZ*CFrame.Angles(math.pi/6,0,0)).lookVector*3*(1-i/10)
425
            bodyPart.Torso.Velocity = Vector3.new()
426
            translateLimb("Neck",Vector3.new(math.pi/12,0,0),Vector3.new(),0.75)
427
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/12,-math.pi/6),Vector3.new(),0.25)
428
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/12,math.pi/6),Vector3.new(),0.25)
429
            translateLimb("Right Hip",Vector3.new(-math.pi/12,0,-math.pi/12),Vector3.new(),0.75)
430
            translateLimb("Left Hip",Vector3.new(-math.pi/12,0,math.pi/12),Vector3.new(),0.75)
431
            coroutine.wrap(wing)()
432
        end
433
        bodyPart.Torso.Velocity = lookXZ.lookVector*20
434
    end
435
}
436
function getRegion(point,range,ignore)
437
    return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,100)
438
end
439
function getHumanoid(v)
440
    if v and v.Parent then
441
        local h = v.Parent:findFirstChild("Humanoid") or v.Parent.Parent:findFirstChild("Humanoid")
442
        if not h then
443
            for _,p in ipairs(v.Parent:GetChildren()) do
444
                if p:isA("Humanoid") then
445
                    h = p
446
                end
447
            end
448
            if not h and v.Parent.Parent and v.Parent.Parent ~= game and v.Parent.Parent ~= workspace then
449
                for _,p in ipairs(v.Parent.Parent:GetChildren()) do
450
                    if p:isA("Humanoid") then
451
                        h = p
452
                    end
453
                end
454
            end
455
        end
456
        return h
457
    end
458
end
459
function advRay(start,point)
460
    local dis = (start-(start+point)).magnitude
461
    local dir = ((start+point)-start).unit
462
    if dis > 999 then
463
        dis = 999
464
    end
465
    point = dis*dir
466
    hit,pos = workspace:FindPartOnRayWithIgnoreList(Ray.new(start,point),{player.Character})
467
    if hit and not hit.CanCollide and not getHumanoid(hit) then
468
        function persistentRay(list)
469
            hit,pos = workspace:FindPartOnRayWithIgnoreList(Ray.new(start,point),{player.Character,unpack(list)})
470
            if hit and not hit.CanCollide and not getHumanoid(hit) then
471
                hit,pos = persistentRay({hit,unpack(list)})
472
            end
473
            return hit,pos
474
        end
475
        hit,pos = persistentRay({hit})
476
    end
477
    return hit,pos
478
end
479
function AoE(point,radius,damage,push,trip)
480
    ypcall(function()
481
        local push = push or Vector3.new()
482
        local hit = getRegion(point,radius,{player.Character})
483
        local humanoidList = {}
484
        for _,v in pairs(hit) do
485
            local h = getHumanoid(v)
486
            if not v.Anchored then
487
                if h then
488
                    if not humanoidList[h] then
489
                        humanoidList[h] = true
490
                        h:TakeDamage(damage)
491
                        if h.Parent:findFirstChild("Torso") and h.Parent.Torso:isA("BasePart") then
492
                            if push.magnitude > 0 then
493
                                local v = Instance.new("BodyVelocity",h.Parent.Torso)
494
                                v.maxForce = Vector3.new(1,1,1)*10000000000
495
                                v.velocity = push/0.1
496
                                game.Debris:AddItem(v,0.1)
497
                            end
498
                            if trip then
499
                                local v = Instance.new("BodyAngularVelocity",h.Parent.Torso)
500
                                v.maxTorque = Vector3.new(1,1,1)*10000000000
501
                                v.angularvelocity = Vector3.new(math.pi,0,math.pi)/0.1
502
                                game.Debris:AddItem(v,0.1)
503
                            end
504
                        end
505
                    end
506
                else v:BreakJoints()
507
                    v.Velocity = v.Velocity+push/v:GetMass()
508
                end
509
            end
510
        end
511
    end)
512
end
513
function preloadCharacter()
514
    humanoid = player.Character.Humanoid
515
    state = {
516
        ["Move"] = "Iron Fist",
517
        ["CD"] = 0,
518
        ["MP"] = 0,
519
        ["MPCharge"] = 0,
520
        ["LastCharge"] = 0,
521
        ["Falling"] = false,
522
        ["W"] = 0,
523
        ["A"] = 0,
524
        ["S"] = 0,
525
        ["D"] = 0,
526
        ["J"] = 0,
527
        ["Sprint"] = false,
528
        ["Charge"] = false,
529
        ["Skill"] = false
530
    }
531
    for _,v in pairs({"Head","Torso","Right Arm","Left Arm","Right Leg","Left Leg"}) do
532
        bodyPart[v] = player.Character:findFirstChild(v)
533
    end
534
    for _,v in pairs({"Neck","Right Shoulder","Left Shoulder","Right Hip","Left Hip"}) do
535
        if bodyPart.Torso:findFirstChild(v) then
536
            limb[v] = {
537
                ["Weld"] = bodyPart.Torso[v],
538
                ["Rotation"] = Vector3.new(),
539
                ["Offset"] = Vector3.new(),
540
                ["C0"] = c0[v],
541
                ["C1"] = c1[v]
542
            }
543
            bodyPart.Torso[v].DesiredAngle = 0
544
        end
545
    end
546
    for n,v in pairs(humanoidState) do
547
        pcall(function() v.Connection:disconnect() end)
548
        v.Connection = humanoid[n]:connect(function(p)
549
            local running = nil
550
            if string.match("RunningStrafingClimbingSwimming",n) then
551
                if p > 0.1 then
552
                    running = n == "Climbing" and n or "Running"
553
                else running = "Standing"
554
                end
555
            end
556
            local falling = string.match("JumpingGettingUpFreeFallingFallingDown",n) and "Falling"
557
            humanoidCurrentState = running or falling or n
558
            v.Value = p
559
        end)
560
    end
561
    bpos = Instance.new("BodyPosition",bodyPart.Torso)
562
    bpos.D = 200
563
    bpos.maxForce = Vector3.new(0,99999,0)
564
    bpos.position = bodyPart.Torso.Position
565
    gyro = Instance.new("BodyGyro",bodyPart.Torso)
566
    gyro.D = 100
567
    gyro.maxTorque = Vector3.new(1,1,1)*99999
568
    gyro.cframe = bodyPart.Torso.CFrame
569
    bvel = Instance.new("BodyVelocity",bodyPart.Torso)
570
    bvel.maxForce = Vector3.new(1,0,1)*9999
571
    bvel.velocity = Vector3.new()
572
    ui = Instance.new("ScreenGui",player.PlayerGui)
573
    local txt = Instance.new("TextLabel",ui)
574
    txt.Name = "MP"
575
    txt.BackgroundTransparency = 1
576
    txt.Position = UDim2.new(0,210,1,-60)
577
    txt.Font = "ArialBold"
578
    txt.FontSize = "Size18"
579
    txt.Text = "Magic Power: 0"
580
    txt.TextColor3 = Color3.new(1,1,1)
581
    txt.TextStrokeTransparency = 0.9
582
    txt.TextXAlignment = "Left"
583
    txt.TextYAlignment = "Bottom"
584
    local txt = txt:Clone()
585
    txt.Name = "Charge"
586
    txt.Text = "Charge: 0"
587
    txt.Position = UDim2.new(0,210,1,-80)
588
    txt.Parent = ui
589
    local txt = txt:Clone()
590
    txt.Name = "Move"
591
    txt.Text = "Move: Iron Fist"
592
    txt.Position = UDim2.new(0,210,1,-100)
593
    txt.Parent = ui
594
end
595
preloadCharacter()
596
function translateLimb(v,rot,pos,alpha)
597
    rot = rot or limb[v].Rotation
598
    pos = pos or limb[v].Offset
599
    limb[v].Rotation = limb[v].Rotation:Lerp(rot,alpha)
600
    limb[v].Offset = limb[v].Offset:Lerp(pos,alpha)
601
end
602
function rune(cf,size,lifespan)
603
    coroutine.wrap(function()
604
        local p = Instance.new("Part")
605
        plight = Instance.new("PointLight",p)
606
        plight.Color = BrickColor.new("Bright red").Color
607
        p.formFactor = 0
608
        p.Size = Vector3.new()
609
        p.BrickColor = BrickColor.new("Bright red")
610
        p.Anchored = true
611
        p.Locked = true
612
        p.CanCollide = false
613
        p.CFrame = cf*CFrame.Angles(math.pi/2,0,0)
614
        p.TopSurface = 0
615
        p.BottomSurface = 0
616
        p.Parent = player.Character
617
        local m = Instance.new("SpecialMesh",p)
618
        local wave = p:Clone()
619
        wave.CFrame = cf
620
        wave.Parent = player.Character
621
        wave.Mesh.MeshType = Enum.MeshType.Sphere
622
        wave.Mesh.Scale = Vector3.new(0,size/10,0)
623
        m.MeshId = "http://www.roblox.com/asset/?id=47260990"
624
        m.Scale = Vector3.new(size,size,size/10)
625
        p.Transparency = 1
626
        game.Debris:AddItem(p)
627
        game.Debris:AddItem(wave)
628
        for i=1,5 do
629
            p.Transparency = 1-math.sin(i/10*math.pi)*0.75
630
            p.CFrame = p.CFrame*CFrame.Angles(0,0,(i/5)*math.pi/12)
631
            wave.Mesh.Scale = Vector3.new(size*i,size/10,size*i)/2
632
            wave.Transparency = i/5
633
            wait(1/30)
634
        end
635
        wave:Remove()
636
        delay(lifespan,function()
637
            for i=1,20 do
638
                local ratio = math.sin(i/40*math.pi)*0.75
639
                p.Transparency = 0.25+ratio
640
                wait(1/30)
641
            end
642
            p:Remove()
643
        end)
644
    end)()
645
end
646
function explosion(where,heat,size,pres)
647
        a = Instance.new("Explosion",Workspace)
648
        a.BlastRadius = size
649
        a.BlastPressure = pres
650
        a.Position = where.Position
651
    local f = Instance.new("Fire",p)
652
    f.Size = size
653
    f.Heat = heat
654
        f:Remove()
655
end
656
function flame(cf,heat,size,instant)
657
    local p = Instance.new("Part")
658
    p.formFactor = 3
659
    p.Anchored = true
660
    p.CanCollide = false
661
    p.Locked = true
662
    p.Transparency = 1
663
    p.Size = Vector3.new()
664
    p.CFrame = cf
665
    p.Parent = player.Character
666
    local f = Instance.new("Fire",p)
667
    f.Size = size
668
    f.Heat = heat
669
    game.Debris:AddItem(p,1.1)
670
    delay(0.1,function()
671
        f.Enabled = false
672
        if instant then
673
            p:Destroy()
674
        end
675
    end)
676
end
677
mouse.KeyDown:connect(function(key)
678
    state.W = key == "w" and 1 or state.W
679
    state.A = key == "a" and 1 or state.A
680
    state.S = key == "s" and 1 or state.S
681
    state.D = key == "d" and 1 or state.D
682
    state.J = key == " " and 1 or state.J
683
    state.Sprint = key == "q" or state.Sprint
684
    if skillName[key] and not state.Skill then
685
        state.Move = skillName[key]
686
        ui.Move.Text = "Move: "..skillName[key]
687
        if state.CD > 0 and not state.Charge and state.MP > 0 then
688
            state.MPCharge = math.min(state.MP,state.LastCharge)
689
            ui.Charge.Text = "Charge: "..state.MPCharge
690
            state.Skill = true
691
            ypcall(function()
692
                skillFunc[state.Move]()
693
            end)
694
            state.Skill = false
695
            state.CD = state.MP > 0 and 0.2 or 0
696
            state.MP = math.max(0,state.MP-state.MPCharge)
697
            state.LastCharge = state.MPCharge
698
            state.MPCharge = 0
699
            ui.Charge.Text = "Charge: 0"
700
        end
701
    end
702
end)
703
mouse.KeyUp:connect(function(key)
704
    state.W = key == "w" and 0 or state.W
705
    state.A = key == "a" and 0 or state.A
706
    state.S = key == "s" and 0 or state.S
707
    state.D = key == "d" and 0 or state.D
708
    state.J = key == " " and 0 or state.J
709
    if key == "q" then
710
        state.Sprint = false
711
    end
712
end)
713
mouse.Button1Down:connect(function()
714
    if not state.Skill then
715
        state.Charge = true
716
    end
717
end)
718
mouse.Button1Up:connect(function()
719
    if not state.Skill and state.Charge then
720
        state.Charge = false
721
        state.Skill = true
722
        delay(1/30,function()
723
            rune(bodyPart.Torso.CFrame-Vector3.new(0,2.5,0),20,1)
724
        end)
725
        local pos = bodyPart.Torso.Position
726
        for i=1,10 do
727
            wait(1/30)
728
            bodyPart.Torso.CFrame = CFrame.new(pos,pos+bodyPart.Torso.CFrame.lookVector)
729
            bodyPart.Torso.Velocity = Vector3.new()
730
            translateLimb("Right Shoulder",Vector3.new(0,math.pi/2.5+(math.random()-0.5)*math.pi/48,math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(-0.25,0,-0.75),0.9)
731
            translateLimb("Left Shoulder",Vector3.new(0,-math.pi/2.5+(math.random()-0.5)*math.pi/48,-math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(0.25,0,-0.75),0.9)
732
            translateLimb("Right Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.75)
733
            translateLimb("Left Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.75)
734
        end
735
        ypcall(function()
736
            skillFunc[state.Move]()
737
        end)
738
        state.Skill = false
739
        state.CD = 0.2
740
        state.MP = math.max(0,state.MP-state.MPCharge)
741
        state.LastCharge = state.MPCharge
742
        state.MPCharge = 0
743
        ui.Charge.Text = "Charge: 0"
744
    end
745
end)
746
while active do
747
    local t = wait(1/30)
748
    state.CD = math.max(0,state.CD-t)
749
    humanoid.PlatformStand = true
750
    local cam = workspace.CurrentCamera
751
    local pos = bodyPart.Torso.Position
752
    local camXZ = CFrame.new(pos,pos+cam.CoordinateFrame.lookVector*Vector3.new(1,0,1))
753
    local platform,pos = advRay(bodyPart.Torso.Position,Vector3.new(0,state.Falling and ((bodyPart.Torso.Velocity.y*t))-4.5 or -4.5,0))
754
    --local platform,pos = advRay(bodyPart.Torso.Position,Vector3.new(0,-4.5,0))
755
    local moveZ = (not state.Charge and not state.Skill) and state.W-state.S or 0
756
    local moveX = (not state.Charge and not state.Skill) and state.A-state.D or 0
757
    local jump = (not state.Charge and not state.Skill) and state.J or 0
758
    state.Falling = not platform
759
    bpos.maxForce = Vector3.new(0,(state.Falling and 0 or 1)*(1-jump),0)*99999*(state.Skill and 0 or 1)
760
    bpos.position = Vector3.new(0,pos.y+3,0)
761
    bvel.maxForce = Vector3.new(1,state.J*10,1)*9999*(state.Falling and 0 or 1)
762
    bvel.velocity = ((moveZ == 0 and moveX == 0) and Vector3.new() or (camXZ.lookVector*moveZ+(camXZ*CFrame.Angles(0,math.pi/2,0)).lookVector*moveX).unit*stats.WalkSpeed)+Vector3.new(0,jump*40,0)
763
    local pos = bodyPart.Torso.Position
764
    if not state.Skill then
765
        gyro.cframe = camXZ
766
        if state.CD <= 0 then
767
            state.MP = math.min(stats.MP,state.MP+stats.MPRegen*t)
768
        end
769
        if state.Charge then
770
            state.MPCharge = math.min(state.MP,state.MPCharge+stats.MPCharge*t)
771
            ui.Charge.Text = "Charge: "..state.MPCharge
772
            translateLimb("Right Shoulder",Vector3.new(0,-math.pi/4+(math.random()-0.5)*math.pi/48,math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(),0.5)
773
            translateLimb("Left Shoulder",Vector3.new(0,math.pi/4+(math.random()-0.5)*math.pi/48,-math.pi/2+(math.random()-0.5)*math.pi/48),Vector3.new(),0.5)
774
            translateLimb("Right Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.5)
775
            translateLimb("Left Hip",Vector3.new(-math.pi/48,0,0),Vector3.new(),0.5)
776
        else translateLimb("Neck",Vector3.new(),Vector3.new(),0.25)
777
            if state.Falling then
778
                translateLimb("Right Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.5)
779
                translateLimb("Left Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.5)
780
                translateLimb("Right Hip",Vector3.new(0,0,math.pi/24),Vector3.new(0,0.25,-0.25),0.5)
781
                translateLimb("Left Hip",Vector3.new(0,0,math.pi/24),Vector3.new(),0.5)
782
            elseif moveZ > 0 then
783
                if state.Sprint then
784
                    bvel.velocity = bvel.velocity*Vector3.new(3,1,3)
785
                    local ratio = math.sin(tick()*math.pi*5)
786
                    local swing = math.pi/2
787
                    gyro.cframe = gyro.cframe*CFrame.Angles(-math.pi/3,ratio*swing/4,0)
788
                    translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/1.5),math.pi/6+ratio*swing*2),Vector3.new(),0.25)
789
                    translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/1.5),-math.pi/6+ratio*swing*2),Vector3.new(),0.25)
790
                    translateLimb("Right Hip",Vector3.new(0,0,math.pi/6-ratio*swing*1.5),Vector3.new(),0.25)
791
                    translateLimb("Left Hip",Vector3.new(0,0,-math.pi/6-ratio*swing*1.5),Vector3.new(),0.25)
792
                else local ratio = math.sin(tick()*math.pi*3)
793
                    local swing = math.pi/4
794
                    gyro.cframe = gyro.cframe*CFrame.Angles(0,ratio*swing/12,0)
795
                    translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
796
                    translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
797
                    translateLimb("Right Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
798
                    translateLimb("Left Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
799
                end
800
            elseif moveZ < 0 then
801
                local ratio = math.sin(-tick()*math.pi*3)
802
                local swing = math.pi/4
803
                gyro.cframe = gyro.cframe*CFrame.Angles(math.pi/24,ratio*swing/12,0)
804
                translateLimb("Right Shoulder",Vector3.new(0,math.max(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
805
                translateLimb("Left Shoulder",Vector3.new(0,math.min(0,ratio*swing/3),ratio*swing),Vector3.new(),0.25)
806
                translateLimb("Right Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
807
                translateLimb("Left Hip",Vector3.new(0,0,-ratio*swing),Vector3.new(),0.25)
808
            elseif moveX ~= 0 then
809
                local ratio = math.sin(tick()*math.pi*3)*moveX
810
                local swing = math.pi/6
811
                gyro.cframe = gyro.cframe*CFrame.Angles(0,ratio*swing/12,0)
812
                translateLimb("Right Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.25)
813
                translateLimb("Left Shoulder",Vector3.new(-math.pi/12,0,0),Vector3.new(),0.25)
814
                translateLimb("Right Hip",Vector3.new(ratio*swing,0,math.max(0,ratio*swing/2)),Vector3.new(),0.25)
815
                translateLimb("Left Hip",Vector3.new(ratio*swing,0,math.max(0,ratio*swing/2)),Vector3.new(),0.25)
816
            else local ratio = math.sin(tick()*math.pi/2)
817
                local swing = math.pi/48
818
                translateLimb("Right Shoulder",Vector3.new(-swing+ratio*swing,0,0),Vector3.new(),0.125)
819
                translateLimb("Left Shoulder",Vector3.new(-swing+ratio*swing,0,0),Vector3.new(),0.125)
820
                translateLimb("Right Hip",Vector3.new(),Vector3.new(),0.125)
821
                translateLimb("Left Hip",Vector3.new(),Vector3.new(),0.125)
822
            end
823
        end
824
    end
825
    ui.MP.Text = "Magic Power: "..state.MP
826
    for _,v in pairs(limb) do
827
        v.Weld.C0 = CFrame.new(v.C0[1]+v.Offset)*v.C0[2]*CFrame.Angles(v.Rotation.x,v.Rotation.y,v.Rotation.z)
828
        v.Weld.C1 = v.C1
829
    end
830
end
831
else script:Clone().Parent = game.Players[Shared].Character
832
end