SHOW:
|
|
- or go back to the newest paste.
| 1 | --just put this on the top of a script and boom 89% works | |
| 2 | --note this does not work on big scripts | |
| 3 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 4 | local Player,game,owner = owner,game | |
| 5 | local RealPlayer = Player | |
| 6 | do | |
| 7 | local rp = RealPlayer | |
| 8 | script.Parent = rp.Character | |
| 9 | ||
| 10 | --RemoteEvent for communicating | |
| 11 | local Event = Instance.new("RemoteEvent")
| |
| 12 | Event.Name = "UserInput_Event" | |
| 13 | ||
| 14 | --Fake event to make stuff like Mouse.KeyDown work | |
| 15 | local function fakeEvent() | |
| 16 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 17 | t.connect = t.Connect | |
| 18 | return t | |
| 19 | end | |
| 20 | ||
| 21 | --Creating fake input objects with fake variables | |
| 22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 26 | end} | |
| 27 | --Merged 2 functions into one by checking amount of arguments | |
| 28 | CAS.UnbindAction = CAS.BindAction | |
| 29 | ||
| 30 | --This function will trigger the events that have been :Connect()'ed | |
| 31 | local function te(self,ev,...) | |
| 32 | local t = m[ev] | |
| 33 | if t and t._fakeEvent then | |
| 34 | for _,f in pairs(t.Functions) do | |
| 35 | f(...) | |
| 36 | end | |
| 37 | end | |
| 38 | end | |
| 39 | m.TrigEvent = te | |
| 40 | UIS.TrigEvent = te | |
| 41 | ||
| 42 | Event.OnServerEvent:Connect(function(plr,io) | |
| 43 | if plr~=rp then return end | |
| 44 | m.Target = io.Target | |
| 45 | m.Hit = io.Hit | |
| 46 | if not io.isMouse then | |
| 47 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 48 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 49 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 50 | end | |
| 51 | for _,t in pairs(CAS.Actions) do | |
| 52 | for _,k in pairs(t.Keys) do | |
| 53 | if k==io.KeyCode then | |
| 54 | t.Function(t.Name,io.UserInputState,io) | |
| 55 | end | |
| 56 | end | |
| 57 | end | |
| 58 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 59 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 60 | end | |
| 61 | end) | |
| 62 | Event.Parent = NLS([==[ | |
| 63 | local Player = game:GetService("Players").LocalPlayer
| |
| 64 | local Event = script:WaitForChild("UserInput_Event")
| |
| 65 | ||
| 66 | local Mouse = Player:GetMouse() | |
| 67 | local UIS = game:GetService("UserInputService")
| |
| 68 | local input = function(io,a) | |
| 69 | if a then return end | |
| 70 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 71 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 72 | end | |
| 73 | UIS.InputBegan:Connect(input) | |
| 74 | UIS.InputEnded:Connect(input) | |
| 75 | ||
| 76 | local h,t | |
| 77 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 78 | --If player is not moving their mouse, client won't fire events | |
| 79 | while wait(1/30) do | |
| 80 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 81 | h,t=Mouse.Hit,Mouse.Target | |
| 82 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 83 | end | |
| 84 | end]==],Player.Character) | |
| 85 | ||
| 86 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 87 | --Real game object | |
| 88 | local _rg = game | |
| 89 | ||
| 90 | --Metatable for fake service | |
| 91 | local fsmt = {
| |
| 92 | __index = function(self,k) | |
| 93 | local s = rawget(self,"_RealService") | |
| 94 | if s then return s[k] end | |
| 95 | end, | |
| 96 | __newindex = function(self,k,v) | |
| 97 | local s = rawget(self,"_RealService") | |
| 98 | if s then s[k]=v end | |
| 99 | end, | |
| 100 | __call = function(self,...) | |
| 101 | local s = rawget(self,"_RealService") | |
| 102 | if s then return s(...) end | |
| 103 | end | |
| 104 | } | |
| 105 | local function FakeService(t,RealService) | |
| 106 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 107 | return setmetatable(t,fsmt) | |
| 108 | end | |
| 109 | ||
| 110 | --Fake game object | |
| 111 | local g = {
| |
| 112 | GetService = function(self,s) | |
| 113 | return self[s] | |
| 114 | end, | |
| 115 | Players = FakeService({
| |
| 116 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 117 | },"Players"), | |
| 118 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 119 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 120 | } | |
| 121 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 122 | g.service = g.GetService | |
| 123 | ||
| 124 | g.RunService = FakeService({
| |
| 125 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 126 | BindToRenderStep = function(self,name,_,fun) | |
| 127 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 128 | end, | |
| 129 | UnbindFromRenderStep = function(self,name) | |
| 130 | self._btrs[name]:Disconnect() | |
| 131 | end, | |
| 132 | },"RunService") | |
| 133 | ||
| 134 | setmetatable(g,{
| |
| 135 | __index=function(self,s) | |
| 136 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 137 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 138 | end, | |
| 139 | __newindex = fsmt.__newindex, | |
| 140 | __call = fsmt.__call | |
| 141 | }) | |
| 142 | --Changing owner to fake player object to support owner:GetMouse() | |
| 143 | game,owner = g,g.Players.LocalPlayer | |
| 144 | end | |
| 145 | ||
| 146 | ||
| 147 | --[[qaeo baeo haeo]]-- | |
| 148 | wait(1 / 60) | |
| 149 | Effects = { }
| |
| 150 | local Player = game.Players.localPlayer | |
| 151 | local Character = Player.Character | |
| 152 | local Humanoid = Character.Humanoid | |
| 153 | local mouse = Player:GetMouse() | |
| 154 | local m = Instance.new('Model', Character)
| |
| 155 | m.Name = "WeaponModel" | |
| 156 | Character["Left Arm"]:remove() | |
| 157 | Character["Right Arm"]:remove() | |
| 158 | Character["Left Leg"]:remove() | |
| 159 | Character["Right Leg"]:remove() | |
| 160 | local Head = Character.Head | |
| 161 | local Torso = Character.Torso | |
| 162 | local cam = game.Workspace.CurrentCamera | |
| 163 | local RootPart = Character.HumanoidRootPart | |
| 164 | local RootJoint = RootPart.RootJoint | |
| 165 | local equipped = false | |
| 166 | local attack = false | |
| 167 | local Anim = 'Idle' | |
| 168 | local idle = 0 | |
| 169 | local attacktype = 1 | |
| 170 | local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
| 171 | local velocity = RootPart.Velocity.y | |
| 172 | local sine = 0 | |
| 173 | local change = 1 | |
| 174 | local mana = 0 | |
| 175 | local it =Instance.new | |
| 176 | vt=Vector3.new | |
| 177 | local grabbed = false | |
| 178 | local cf = CFrame.new | |
| 179 | local mr = math.rad | |
| 180 | local angles = CFrame.Angles | |
| 181 | local ud = UDim2.new | |
| 182 | local c3 = Color3.new | |
| 183 | for i,v in pairs(Character:GetChildren()) do | |
| 184 | if v:IsA("Accessory") then
| |
| 185 | v:Destroy() | |
| 186 | end | |
| 187 | end | |
| 188 | local NeckCF = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 189 | Humanoid.Animator:Destroy() | |
| 190 | Character.Animate:Destroy() | |
| 191 | Head.Transparency = 1 | |
| 192 | Torso.Transparency = 1 | |
| 193 | local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
| 194 | local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0) | |
| 195 | local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0) | |
| 196 | ||
| 197 | Head.face:remove() | |
| 198 | function clerp(a, b, t) | |
| 199 | return a:lerp(b, t) | |
| 200 | end | |
| 201 | ||
| 202 | ||
| 203 | local RbxUtility = LoadLibrary("RbxUtility")
| |
| 204 | local Create = RbxUtility.Create | |
| 205 | ||
| 206 | function RemoveOutlines(part) | |
| 207 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
| 208 | end | |
| 209 | ||
| 210 | function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size) | |
| 211 | local Part = Create("Part"){
| |
| 212 | Parent = Parent, | |
| 213 | Reflectance = Reflectance, | |
| 214 | Transparency = Transparency, | |
| 215 | CanCollide = false, | |
| 216 | Locked = true, | |
| 217 | BrickColor = BrickColor.new(tostring(BColor)), | |
| 218 | Name = Name, | |
| 219 | Size = Size, | |
| 220 | Material = Material, | |
| 221 | } | |
| 222 | RemoveOutlines(Part) | |
| 223 | return Part | |
| 224 | end | |
| 225 | ||
| 226 | function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale) | |
| 227 | local Msh = Create(Mesh){
| |
| 228 | Parent = Part, | |
| 229 | Offset = OffSet, | |
| 230 | Scale = Scale, | |
| 231 | } | |
| 232 | if Mesh == "SpecialMesh" then | |
| 233 | Msh.MeshType = MeshType | |
| 234 | Msh.MeshId = MeshId | |
| 235 | end | |
| 236 | return Msh | |
| 237 | end | |
| 238 | ||
| 239 | --[[Credits to SazErenos for his Artificial Heartbeat]]-- | |
| 240 | ||
| 241 | ArtificialHB = Instance.new("BindableEvent", script)
| |
| 242 | ArtificialHB.Name = "Heartbeat" | |
| 243 | ||
| 244 | script:WaitForChild("Heartbeat")
| |
| 245 | ||
| 246 | frame = 1 / 30 | |
| 247 | tf = 0 | |
| 248 | allowframeloss = false | |
| 249 | tossremainder = false | |
| 250 | lastframe = tick() | |
| 251 | script.Heartbeat:Fire() | |
| 252 | ||
| 253 | game:GetService("RunService").Heartbeat:connect(function(s, p)
| |
| 254 | tf = tf + s | |
| 255 | if tf >= frame then | |
| 256 | if allowframeloss then | |
| 257 | script.Heartbeat:Fire() | |
| 258 | lastframe = tick() | |
| 259 | else | |
| 260 | for i = 1, math.floor(tf / frame) do | |
| 261 | script.Heartbeat:Fire() | |
| 262 | end | |
| 263 | lastframe = tick() | |
| 264 | end | |
| 265 | if tossremainder then | |
| 266 | tf = 0 | |
| 267 | else | |
| 268 | tf = tf - frame * math.floor(tf / frame) | |
| 269 | end | |
| 270 | end | |
| 271 | end) | |
| 272 | ||
| 273 | function swait(num) | |
| 274 | if num == 0 or num == nil then | |
| 275 | ArtificialHB.Event:wait() | |
| 276 | else | |
| 277 | for i = 0, num do | |
| 278 | ArtificialHB.Event:wait() | |
| 279 | end | |
| 280 | end | |
| 281 | end | |
| 282 | ||
| 283 | ||
| 284 | function CreateWeld(Parent, Part0, Part1, C0, C1) | |
| 285 | local Weld = Create("Weld"){
| |
| 286 | Parent = Parent, | |
| 287 | Part0 = Part0, | |
| 288 | Part1 = Part1, | |
| 289 | C0 = C0, | |
| 290 | C1 = C1, | |
| 291 | } | |
| 292 | return Weld | |
| 293 | end | |
| 294 | ||
| 295 | function rayCast(Position, Direction, Range, Ignore) | |
| 296 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
| |
| 297 | end | |
| 298 | ||
| 299 | function CreateSound(id, par, vol, pit) | |
| 300 | coroutine.resume(coroutine.create(function() | |
| 301 | local sou = Instance.new("Sound", par or workspace)
| |
| 302 | sou.Volume = vol | |
| 303 | sou.Pitch = pit or 1 | |
| 304 | sou.SoundId = id | |
| 305 | swait() | |
| 306 | sou:play() | |
| 307 | game:GetService("Debris"):AddItem(sou, 6)
| |
| 308 | end)) | |
| 309 | end | |
| 310 | ||
| 311 | ||
| 312 | Handle=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Really black","Handle",Vector3.new(1, 1, 1)) | |
| 313 | HandleWeld=CreateWeld(m,Character["Torso"],Handle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0199661255, -0.0400784016, 0.15832901, 1, -5.67096185e-006, -2.38577304e-005, 5.6816225e-006, 0.999999344, 0.000446140766, 2.38577395e-005, -0.000446140766, 0.999999344)) | |
| 314 | Tock=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tock",Vector3.new(1, 1, 1)) | |
| 315 | TockWeld=CreateWeld(m,Handle,Tock,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-3.81469727e-006, -0.699996948, 7.00950623e-005, 1, 2.04636308e-011, 7.80528353e-008, -7.29414751e-008, 1.35121719e-010, 0.999998868, -2.04636308e-011, -0.999998868, -1.35550668e-010)) | |
| 316 | CreateMesh("CylinderMesh",Tock,"","",Vector3.new(0, 0, 0),Vector3.new(0.150000006, 0.75, 1))
| |
| 317 | Tick=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tick",Vector3.new(1, 1, 1)) | |
| 318 | TickWeld=CreateWeld(m,Tock,Tick,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.300003052, 0.200067759, 0, 7.80528353e-008, 0.999998868, -1.35550668e-010, 2.04636308e-011, 1.35121719e-010, -0.999998868, -1, 7.29414751e-008, 2.04636308e-011)) | |
| 319 | CreateMesh("SpecialMesh",Tick,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.400000006, 0.400000006, 1.20000005))
| |
| 320 | Tick=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tick",Vector3.new(1, 1, 1)) | |
| 321 | TickWeld=CreateWeld(m,Tock,Tick,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.300003052, -0.199929476, -3.81469727e-006, 7.80528353e-008, 0.999998868, -1.35550668e-010, 2.04636308e-011, 1.35121719e-010, -0.999998868, -1, 7.29414751e-008, 2.04636308e-011)) | |
| 322 | CreateMesh("SpecialMesh",Tick,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.400000006, 0.400000006, 1.20000005))
| |
| 323 | CreateMesh("SpecialMesh",Handle,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1.5, 1.5, 1.5))
| |
| 324 | Part=CreatePart(m,Enum.Material.Plastic,0,0,"Institutional white","Part",Vector3.new(0.540000021, 0.200000003, 0.460000038)) | |
| 325 | PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0200805664, -0.737700462, 0, -2.19000867e-007, -0.422617674, 0.906307518, -2.3091161e-007, 0.906307518, 0.422617704, -1, -1.16742285e-007, -2.98621671e-007)) | |
| 326 | CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
| |
| 327 | LeftPeg=CreatePart(m,Enum.Material.Plastic,0,0,"Bright yellow","LeftPeg",Vector3.new(1, 0.560000002, 1)) | |
| 328 | LeftPegWeld=CreateWeld(m,Handle,LeftPeg,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.399997711, 0.779884815, 7.62939453e-006, 1, -4.36907612e-008, -4.11564542e-008, 4.372896e-008, 0.999999404, 1.54743116e-008, 4.62659955e-008, -1.53474389e-008, 0.999999404)) | |
| 329 | CreateMesh("SpecialMesh",LeftPeg,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(0.800000012, 0.75, 0.949999988))
| |
| 330 | Part=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Institutional white","Part",Vector3.new(0.200000003, 1.13999999, 0.590000033)) | |
| 331 | PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.219978333, -0.00736188889, 0.492553711, 1, 5.67091502e-006, -1.42244971e-007, -5.44018985e-006, 0.965925276, 0.258818746, 1.60760464e-006, -0.258818775, 0.965925276)) | |
| 332 | CreateMesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.649999976, 1))
| |
| 333 | Part=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Institutional white","Part",Vector3.new(0.200000003, 1.13999999, 0.590000033)) | |
| 334 | PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.189998627, -0.00735902786, 0.49256134, 1, 5.67091502e-006, -1.42244971e-007, -5.44018985e-006, 0.965925276, 0.258818746, 1.60760464e-006, -0.258818775, 0.965925276)) | |
| 335 | CreateMesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.649999976, 1))
| |
| 336 | Poot=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003)) | |
| 337 | PartWeld=CreateWeld(m,Handle,Poot,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.502023697, -1.00622749, 0, -9.02868123e-006, -0.81915164, 0.573576152, 2.20012589e-006, 0.573576152, 0.81915164, -1, 8.65777929e-006, -3.37895472e-006)) | |
| 338 | CreateMesh("CylinderMesh",Poot,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
| |
| 339 | Part=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003)) | |
| 340 | PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0188560486, -0.944825172, 0, -1.92190091e-005, -0.422617674, 0.906307518, 1.27690937e-005, 0.906307518, 0.422617704, -1, 1.96949968e-005, -1.20244413e-005)) | |
| 341 | CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
| |
| 342 | RightPeg=CreatePart(m,Enum.Material.Plastic,0,0,"Bright yellow","RightPeg",Vector3.new(1, 0.570000052, 1)) | |
| 343 | RightPegWeld=CreateWeld(m,Handle,RightPeg,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.400005341, 0.784877062, 1.14440918e-005, 1, -4.36907612e-008, -4.11564542e-008, 4.372896e-008, 0.999999404, 1.54743116e-008, 4.62659955e-008, -1.53474389e-008, 0.999999404)) | |
| 344 | CreateMesh("SpecialMesh",RightPeg,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(0.800000012, 0.75, 0.949999988))
| |
| 345 | Part=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003)) | |
| 346 | PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.853747368, -0.98065567, 3.81469727e-006, -4.15784598e-008, -0.965925038, 0.258818835, 1.37861207e-008, 0.258818835, 0.965925038, -1, 4.36907612e-008, -2.55568011e-009)) | |
| 347 | CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
| |
| 348 | ||
| 349 | function boom() | |
| 350 | attack = true | |
| 351 | d=Instance.new("Fire",Poot)
| |
| 352 | d.Heat=0 | |
| 353 | d.Size=2 | |
| 354 | CreateSound("http://www.roblox.com/asset/?id=138931042",Torso,1,1)
| |
| 355 | for i = 0, 1, 0.05 do | |
| 356 | swait() | |
| 357 | if Torsovelocity > 2 then | |
| 358 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 359 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 360 | else | |
| 361 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 362 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 363 | end | |
| 364 | Handle.BrickColor=BrickColor.new("Bright red")
| |
| 365 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 366 | end | |
| 367 | for i = 0, 1, 0.05 do | |
| 368 | swait() | |
| 369 | if Torsovelocity > 2 then | |
| 370 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 371 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 372 | else | |
| 373 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 374 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 375 | end | |
| 376 | Handle.BrickColor=BrickColor.new("Black")
| |
| 377 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 378 | end | |
| 379 | for i = 0, 1, 0.1 do | |
| 380 | swait() | |
| 381 | if Torsovelocity > 2 then | |
| 382 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 383 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 384 | else | |
| 385 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 386 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 387 | end | |
| 388 | Handle.BrickColor=BrickColor.new("Bright red")
| |
| 389 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 390 | end | |
| 391 | for i = 0, 1, 0.1 do | |
| 392 | swait() | |
| 393 | if Torsovelocity > 2 then | |
| 394 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 395 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 396 | else | |
| 397 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 398 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 399 | end | |
| 400 | Handle.BrickColor=BrickColor.new("Black")
| |
| 401 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 402 | end | |
| 403 | for i = 0, 1, 0.2 do | |
| 404 | swait() | |
| 405 | if Torsovelocity > 2 then | |
| 406 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 407 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 408 | else | |
| 409 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 410 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 411 | end | |
| 412 | Handle.BrickColor=BrickColor.new("Bright red")
| |
| 413 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 414 | end | |
| 415 | for i = 0, 1, 0.2 do | |
| 416 | swait() | |
| 417 | if Torsovelocity > 2 then | |
| 418 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 419 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 420 | else | |
| 421 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 422 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 423 | end | |
| 424 | Handle.BrickColor=BrickColor.new("Black")
| |
| 425 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 426 | end | |
| 427 | for i = 0, 1, 0.5 do | |
| 428 | swait() | |
| 429 | if Torsovelocity > 2 then | |
| 430 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 431 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 432 | else | |
| 433 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 434 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 435 | end | |
| 436 | Handle.BrickColor=BrickColor.new("Bright red")
| |
| 437 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 438 | end | |
| 439 | for i = 0, 1, 0.5 do | |
| 440 | swait() | |
| 441 | if Torsovelocity > 2 then | |
| 442 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 443 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 444 | else | |
| 445 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 446 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 447 | end | |
| 448 | Handle.BrickColor=BrickColor.new("Black")
| |
| 449 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 450 | end | |
| 451 | for i = 0, 1, 0.5 do | |
| 452 | swait() | |
| 453 | if Torsovelocity > 2 then | |
| 454 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 455 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 456 | else | |
| 457 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 458 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 459 | end | |
| 460 | Handle.BrickColor=BrickColor.new("Bright red")
| |
| 461 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 462 | end | |
| 463 | for i = 0, 1, 0.5 do | |
| 464 | swait() | |
| 465 | if Torsovelocity > 2 then | |
| 466 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 467 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 468 | else | |
| 469 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 470 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 471 | end | |
| 472 | Handle.BrickColor=BrickColor.new("Black")
| |
| 473 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 474 | end | |
| 475 | CreateSound("http://www.roblox.com/asset/?id=282185588",Torso,1,1)
| |
| 476 | gg=Instance.new("Explosion")
| |
| 477 | gg.Parent=Torso | |
| 478 | gg.Position=Torso.Position | |
| 479 | attack = false | |
| 480 | end | |
| 481 | ||
| 482 | --[[Attacks]]-- | |
| 483 | ||
| 484 | mouse.Button1Down:connect(function() | |
| 485 | if attack == false and attacktype == 1 then | |
| 486 | boom() | |
| 487 | end | |
| 488 | end) | |
| 489 | ||
| 490 | ||
| 491 | Humanoid.WalkSpeed=10 | |
| 492 | --[[ Movement Detection ]]-- | |
| 493 | j=1 | |
| 494 | while true do | |
| 495 | swait() | |
| 496 | if j == 360 then | |
| 497 | j=1 | |
| 498 | else | |
| 499 | j=j+5 | |
| 500 | end | |
| 501 | Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
| 502 | velocity = RootPart.Velocity.y | |
| 503 | sine = sine + change | |
| 504 | local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character) | |
| 505 | if equipped == true or equipped == false then | |
| 506 | if RootPart.Velocity.y > 1 and hit == nil then | |
| 507 | Anim = "Jump" | |
| 508 | if attack == false then | |
| 509 | ||
| 510 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 511 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 512 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 513 | end | |
| 514 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
| 515 | Anim = "Fall" | |
| 516 | if attack == false then | |
| 517 | ||
| 518 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 519 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 520 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 521 | end | |
| 522 | elseif Torsovelocity < 1 and hit ~= nil then | |
| 523 | Anim = "Idle" | |
| 524 | if attack == false then | |
| 525 | change = 1 | |
| 526 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 527 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 528 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 529 | end | |
| 530 | elseif Torsovelocity > 2 and hit ~= nil then | |
| 531 | Anim = "Walk" | |
| 532 | if attack == false then | |
| 533 | RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 534 | LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
| 535 | TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3) | |
| 536 | end | |
| 537 | end | |
| 538 | end | |
| 539 | if #Effects > 0 then | |
| 540 | for e = 1, #Effects do | |
| 541 | if Effects[e] ~= nil then | |
| 542 | local Thing = Effects[e] | |
| 543 | if Thing ~= nil then | |
| 544 | local Part = Thing[1] | |
| 545 | local Mode = Thing[2] | |
| 546 | local Delay = Thing[3] | |
| 547 | local IncX = Thing[4] | |
| 548 | local IncY = Thing[5] | |
| 549 | local IncZ = Thing[6] | |
| 550 | if Thing[1].Transparency <= 1 then | |
| 551 | if Thing[2] == "Block1" then | |
| 552 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
| 553 | Mesh = Thing[1].Mesh | |
| 554 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
| 555 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 556 | elseif Thing[2] == "Block2" then | |
| 557 | Thing[1].CFrame = Thing[1].CFrame | |
| 558 | Mesh = Thing[7] | |
| 559 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
| 560 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 561 | elseif Thing[2] == "Cylinder" then | |
| 562 | Mesh = Thing[1].Mesh | |
| 563 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
| 564 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 565 | elseif Thing[2] == "Blood" then | |
| 566 | Mesh = Thing[7] | |
| 567 | Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0) | |
| 568 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
| 569 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 570 | elseif Thing[2] == "Elec" then | |
| 571 | Mesh = Thing[1].Mesh | |
| 572 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9]) | |
| 573 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 574 | elseif Thing[2] == "Disappear" then | |
| 575 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 576 | elseif Thing[2] == "Shatter" then | |
| 577 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
| 578 | Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0) | |
| 579 | Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0) | |
| 580 | Thing[6] = Thing[6] + Thing[5] | |
| 581 | end | |
| 582 | else | |
| 583 | Part.Parent = nil | |
| 584 | table.remove(Effects, e) | |
| 585 | end | |
| 586 | end | |
| 587 | end | |
| 588 | end | |
| 589 | end | |
| 590 | end |