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