SHOW:
|
|
- or go back to the newest paste.
| 1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 2 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
| 3 | local RealPlayer = Player | |
| 4 | do warn("FE Converter Made By Waverly And Mokiros, Re-Arranged By Zxmbi~");InternalData = {}InternalData.RealOwner = owner;InternalData.RealObjs = {};InternalData.SoundLoudness = {};local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end,__call=function(self,...)local t=rawget(self,"_RealService")if t then return t(...)end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return self[t]end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;x.RunService=v({RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")setmetatable(x,{__index=function(self,t)return r:GetService(t)or typeof(r[t])=="function"and function(m,...)return r[t](r,...)end or r[t]end,__newindex=s.__newindex,__call=s.__call})game,owner=x,x.Players.LocalPlayer
| |
| 5 | script.Parent = InternalData.RealOwner.Character | |
| 6 | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput";InternalData.Event = Event
| |
| 7 | local function createObject (connections, index) | |
| 8 | local proxy = newproxy (true);local meta = getmetatable (proxy); | |
| 9 | local runbind = function (self, i, ...) connections[i]:Fire (...); end; | |
| 10 | while (#connections > 0) do connections[table.remove(connections, 1)] = Instance.new ('BindableEvent');end;
| |
| 11 | meta.__index = function (self, i) | |
| 12 | if (i == 'TriggerEvent') then return runbind end; | |
| 13 | return connections[i] and connections[i].Event or index[i]; | |
| 14 | end; | |
| 15 | meta.__newindex = index;meta.__metatable = false;return proxy | |
| 16 | end; | |
| 17 | local Mouse = createObject({"KeyUp","KeyDown","Button1Down","Button1Up"},{["Target"] = nil;["Hit"] = CFrame.new()})
| |
| 18 | local UserInputService = createObject({"InputBegan","InputEnded"},{})
| |
| 19 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
| |
| 20 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
| |
| 21 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
| 22 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
| 23 | if FiredBy ~= InternalData.RealOwner then return end | |
| 24 | if Input.MouseEvent then | |
| 25 | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit | |
| 26 | elseif Input.Sound then | |
| 27 | if InternalData.SoundLoudness[Input.Sound] then InternalData.SoundLoudness[Input.Sound] = Input.Loudness end | |
| 28 | else | |
| 29 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
| 30 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TriggerEvent(Begin and "Button1Down" or "Button1Up") end | |
| 31 | for _,Action in pairs(ContextActionService.Actions) do | |
| 32 | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end | |
| 33 | end | |
| 34 | Mouse:TriggerEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower());UserInputService:TriggerEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
| 35 | end | |
| 36 | end) | |
| 37 | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService | |
| 38 | Event.Parent = NLS([[ | |
| 39 | local Player = owner; | |
| 40 | local Sounds = {};
| |
| 41 | local Event = script:WaitForChild("UserInput");
| |
| 42 | local UserInputService = game:GetService("UserInputService");
| |
| 43 | local Mouse = Player:GetMouse(); | |
| 44 | local Input = function(Input,gameProcessedEvent) | |
| 45 | if gameProcessedEvent then return end | |
| 46 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
| |
| 47 | end | |
| 48 | Event.OnClientEvent:connect(function(Args) | |
| 49 | if Args[1] == "NewSound" then table.insert(Sounds,Args[2]) end | |
| 50 | end) | |
| 51 | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) | |
| 52 | local Hit,Target | |
| 53 | while wait(1/30) do | |
| 54 | for x,Sound in pairs(Sounds) do | |
| 55 | if Sound.Parent then Event:FireServer({["Sound"]=Sound,["Loudness"]=Sound.PlaybackLoudness}) end
| |
| 56 | end | |
| 57 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
| 58 | Hit = Mouse.Hit;Target = Mouse.Target; | |
| 59 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
| |
| 60 | end | |
| 61 | end | |
| 62 | ]],InternalData.RealOwner.Character) | |
| 63 | end | |
| 64 | InternalData.NewOwner = setmetatable({},{
| |
| 65 | __index = function (self,Index) | |
| 66 | local Type = type(InternalData.RealOwner[Index]) | |
| 67 | if Type == "function" then | |
| 68 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
| 69 | return function (self)return InternalData["Mouse"] end | |
| 70 | end | |
| 71 | return function (self,...)return InternalData.RealOwner[Index](InternalData.RealOwner,...) end | |
| 72 | elseif Index == "FakePlayer" then | |
| 73 | return true | |
| 74 | end | |
| 75 | return InternalData.RealOwner[Index] | |
| 76 | end; | |
| 77 | __tostring = function(self) return tostring(InternalData.RealOwner) end | |
| 78 | }) | |
| 79 | --LoadLibrary("RbxUtility").Create
| |
| 80 | InternalData.LoadLibrary = LoadLibrary;LoadLibrary = function(Library) | |
| 81 | if Library == "RbxUtility" then | |
| 82 | return setmetatable({},{
| |
| 83 | __tostring = function() return "RbxUtility" end; | |
| 84 | __index = function(self, Index) | |
| 85 | if Index:lower() == "create" then | |
| 86 | return function(Type) | |
| 87 | return function(Data) | |
| 88 | Data = Data or {}
| |
| 89 | local Inst = Instance.new(Type) | |
| 90 | for x,y in pairs(Data) do | |
| 91 | if InternalData.RealObjs[y] then y = InternalData.RealObjs[y] end | |
| 92 | if y == owner then y = InternalData.RealOwner end | |
| 93 | Inst[x] = y | |
| 94 | end | |
| 95 | return Inst | |
| 96 | end | |
| 97 | end | |
| 98 | end | |
| 99 | return InternalData.LoadLibrary(Library)[Index] | |
| 100 | end | |
| 101 | }) | |
| 102 | end | |
| 103 | return InternalData.LoadLibrary(Library) | |
| 104 | end | |
| 105 | InternalData.RealInstance = Instance;Instance = setmetatable({},{
| |
| 106 | __index = function (self,Index) | |
| 107 | if Index:lower() == 'new' then | |
| 108 | return function (Type, Parent) | |
| 109 | if Parent == owner then Parent = InternalData.RealOwner end | |
| 110 | if InternalData.RealObjs[Parent] then Parent = InternalData.RealObjs[Parent] end | |
| 111 | local Real = InternalData.RealInstance.new(Type,Parent) | |
| 112 | if not Type then return end | |
| 113 | if Type == "BillboardGui" then | |
| 114 | local ToReturn = setmetatable({},{
| |
| 115 | __index = function (self,Index) | |
| 116 | if type(Real[Index]) == "function" then | |
| 117 | if Index:lower() == "clone" then | |
| 118 | return function (self) | |
| 119 | local Real = Real:Clone() | |
| 120 | local ToReturn = setmetatable({RealObject = Real},{
| |
| 121 | __index = function (self,Index) | |
| 122 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
| 123 | return Real[Index] | |
| 124 | end; | |
| 125 | __newindex = function (self,Index,Value) | |
| 126 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 127 | if Value == owner then Value = InternalData.RealOwner end | |
| 128 | Real[Index] = Value | |
| 129 | end; | |
| 130 | __tostring = function(self) return tostring(Real) end; | |
| 131 | }) | |
| 132 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
| 133 | end | |
| 134 | end | |
| 135 | return function (self,...) return Real[Index](Real,...)end | |
| 136 | end | |
| 137 | return Real[Index] | |
| 138 | end; | |
| 139 | __newindex = function (self,Index,Value) | |
| 140 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 141 | if Value == owner then Value = InternalData.RealOwner end | |
| 142 | Real[Index] = Value | |
| 143 | end; | |
| 144 | __tostring = function(self) return tostring(Real) end; | |
| 145 | }) | |
| 146 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
| 147 | elseif Type:lower() == "sound" then | |
| 148 | Real.Parent = owner.Character; | |
| 149 | local ToReturn = setmetatable({RealObject = Real},{
| |
| 150 | __index = function (self,Index) | |
| 151 | if Index:lower() == "playbackloudness" then | |
| 152 | return InternalData.SoundLoudness[Real] or 0 | |
| 153 | elseif type(Real[Index]) == "function" then | |
| 154 | if Index:lower() == "clone" then | |
| 155 | return function (self) | |
| 156 | local Real = Real:Clone() | |
| 157 | local ToReturn = setmetatable({},{
| |
| 158 | __index = function (self,Index) | |
| 159 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
| 160 | return Real[Index] | |
| 161 | end; | |
| 162 | __newindex = function (self,Index,Value) | |
| 163 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 164 | if Value == owner then Value = InternalData.RealOwner end | |
| 165 | Real[Index] = Value | |
| 166 | end; | |
| 167 | __tostring = function(self) return tostring(Real) end; | |
| 168 | }) | |
| 169 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
| 170 | end | |
| 171 | end | |
| 172 | return function (self,...) return Real[Index](Real,...)end | |
| 173 | end | |
| 174 | return Real[Index] | |
| 175 | end; | |
| 176 | __newindex = function (self,Index,Value) | |
| 177 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 178 | if Value == owner then Value = InternalData.RealOwner end | |
| 179 | Real[Index] = Value | |
| 180 | end; | |
| 181 | __tostring = function(self) return tostring(Real) end; | |
| 182 | }) | |
| 183 | InternalData.RealObjs[ToReturn] = Real;InternalData.SoundLoudness[Real] = 0;repeat wait() until InternalData.Event.Parent InternalData.Event:FireClient(InternalData.RealOwner,{"NewSound",Real}) return ToReturn;
| |
| 184 | else | |
| 185 | local ToReturn = setmetatable({RealObject = Real},{
| |
| 186 | __index = function (self,Index) | |
| 187 | if type(Real[Index]) == "function" then | |
| 188 | if Index:lower() == "clone" then | |
| 189 | return function (self) | |
| 190 | local Real = Real:Clone() | |
| 191 | local ToReturn = setmetatable({},{
| |
| 192 | __index = function (self,Index) | |
| 193 | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end | |
| 194 | return Real[Index] | |
| 195 | end; | |
| 196 | __newindex = function (self,Index,Value) | |
| 197 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 198 | if Value == owner then Value = InternalData.RealOwner end | |
| 199 | Real[Index] = Value | |
| 200 | end; | |
| 201 | __tostring = function(self) return tostring(Real) end; | |
| 202 | }) | |
| 203 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
| 204 | end | |
| 205 | end | |
| 206 | return function (self,...) return Real[Index](Real,...)end | |
| 207 | end | |
| 208 | return Real[Index] | |
| 209 | end; | |
| 210 | __newindex = function (self,Index,Value) | |
| 211 | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end | |
| 212 | if Value == owner then Value = InternalData.RealOwner end | |
| 213 | Real[Index] = Value | |
| 214 | end; | |
| 215 | __tostring = function(self) return tostring(Real) end; | |
| 216 | }) | |
| 217 | InternalData.RealObjs[ToReturn] = Real;return ToReturn; | |
| 218 | end | |
| 219 | end | |
| 220 | end | |
| 221 | return InternalData.RealInstance[Index] | |
| 222 | end; | |
| 223 | __tostring = function(self) return tostring(InternalData.RealInstance) end; | |
| 224 | }); | |
| 225 | InternalData.RealGame = game;game = setmetatable({},{
| |
| 226 | __index = function (self,Index) | |
| 227 | if InternalData.RealGame[Index] then | |
| 228 | local Type = type(InternalData.RealGame[Index]) | |
| 229 | if Type == "function" then | |
| 230 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
| 231 | return function (self,Service) | |
| 232 | local FakeServices = {
| |
| 233 | ["players"] = function() | |
| 234 | return setmetatable({},{
| |
| 235 | __index = function (self2,Index2) | |
| 236 | local RealService = InternalData.RealGame:GetService(Service) | |
| 237 | local Type2 = type(RealService[Index2]) | |
| 238 | if Type2 == "function" then | |
| 239 | return function (self,...) return RealService[Index2](RealService,...)end | |
| 240 | else | |
| 241 | if Index2:lower() == "localplayer" then return InternalData.NewOwner end | |
| 242 | return RealService[Index2] | |
| 243 | end | |
| 244 | end; | |
| 245 | __tostring = function(self) return tostring(InternalData.RealGame:GetService(Service)) end | |
| 246 | }) | |
| 247 | end; | |
| 248 | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; | |
| 249 | ["userinputservice"] = function() return InternalData["UserInputService"] end; | |
| 250 | ["debris"] = function() | |
| 251 | return setmetatable({},{
| |
| 252 | __index = function(self2,Index2) | |
| 253 | local RealService = InternalData.RealGame:GetService(Service) | |
| 254 | local Type2 = type(RealService[Index2]) | |
| 255 | if Type2 == "function" then | |
| 256 | if Index2:lower() == "additem" then | |
| 257 | return function (self,Item,Time) | |
| 258 | if InternalData.RealObjs[Item] then Item = InternalData.RealObjs[Item] end | |
| 259 | return RealService:AddItem(Item,Time) | |
| 260 | end | |
| 261 | end | |
| 262 | return function (self,...) return RealService[Index2](RealService,...) end | |
| 263 | end | |
| 264 | return RealService[Index2] | |
| 265 | end; | |
| 266 | __tostring = function(self) return tostring(InternalData.RealGame:GetService("Debris")) end
| |
| 267 | }) | |
| 268 | end; | |
| 269 | ["runservice"] = function() | |
| 270 | return setmetatable({},{
| |
| 271 | __index = function(self2,Index2) | |
| 272 | local RealService = InternalData.RealGame:GetService(Service) | |
| 273 | local Type2 = type(RealService[Index2]) | |
| 274 | if Type2 == "function" then | |
| 275 | return function (self,...) return RealService[Index2](RealService,...) end | |
| 276 | else | |
| 277 | local RunServices = {
| |
| 278 | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return InternalData.RealGame:GetService("RunService").Stepped:Connect(Function) end end;
| |
| 279 | ["renderstepped"] = function() return RealService["Stepped"] end | |
| 280 | } | |
| 281 | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end | |
| 282 | return RealService[Index2] | |
| 283 | end | |
| 284 | end; | |
| 285 | __tostring = function(self) return tostring(InternalData.RealGame:GetService("RunService")) end
| |
| 286 | }) | |
| 287 | end | |
| 288 | } | |
| 289 | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end | |
| 290 | return InternalData.RealGame:GetService(Service) | |
| 291 | end | |
| 292 | end | |
| 293 | return function (self,...) return InternalData.RealGame[Index](InternalData.RealGame,...) end | |
| 294 | else | |
| 295 | if game:GetService(Index) then return game:GetService(Index) end | |
| 296 | return InternalData.RealGame[Index] | |
| 297 | end | |
| 298 | end | |
| 299 | return nil | |
| 300 | end; | |
| 301 | __tostring = function(self) return tostring(InternalData.game) end | |
| 302 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");warn("Loaded! Have Fun!")
| |
| 303 | ||
| 304 | wait(1/60) | |
| 305 | --// Shortcut Variables \\-- | |
| 306 | local S = setmetatable({},{__index = function(s,i) return game:service(i) end})
| |
| 307 | local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
| |
| 308 | local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV}
| |
| 309 | local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis}
| |
| 310 | local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge,RRNG = function(min,max,div) return math.rad(math.random(min,max)/(div or 1)) end}
| |
| 311 | local R3 = {N=Region3.new}
| |
| 312 | local De = S.Debris | |
| 313 | local WS = workspace | |
| 314 | local Lght = S.Lighting | |
| 315 | local RepS = S.ReplicatedStorage | |
| 316 | local IN = Instance.new | |
| 317 | local Plrs = S.Players | |
| 318 | ||
| 319 | --// Initializing \\-- | |
| 320 | local Plr = Plrs.LocalPlayer | |
| 321 | local Char = Plr.Character | |
| 322 | local Hum = Char:FindFirstChildOfClass'Humanoid' | |
| 323 | local RArm = Char["Right Arm"] | |
| 324 | local LArm = Char["Left Arm"] | |
| 325 | local RLeg = Char["Right Leg"] | |
| 326 | local LLeg = Char["Left Leg"] | |
| 327 | local Root = Char:FindFirstChild'HumanoidRootPart' | |
| 328 | local Torso = Char.Torso | |
| 329 | local Head = Char.Head | |
| 330 | local NeutralAnims = true | |
| 331 | local Attack = false | |
| 332 | local Debounces = {Debounces={}}
| |
| 333 | local Mouse = Plr:GetMouse() | |
| 334 | local Hit = {}
| |
| 335 | local Sine = 0 | |
| 336 | local Change = 1 | |
| 337 | local BloodPuddles = {}
| |
| 338 | ||
| 339 | local Effects = IN("Folder",Char)
| |
| 340 | Effects.Name = "Effects" | |
| 341 | ||
| 342 | ||
| 343 | --// Debounce System \\-- | |
| 344 | ||
| 345 | ||
| 346 | function Debounces:New(name,cooldown) | |
| 347 | local aaaaa = {Usable=true,Cooldown=cooldown or 2,CoolingDown=false,LastUse=0}
| |
| 348 | setmetatable(aaaaa,{__index = Debounces})
| |
| 349 | Debounces.Debounces[name] = aaaaa | |
| 350 | return aaaaa | |
| 351 | end | |
| 352 | ||
| 353 | function Debounces:Use(overrideUsable) | |
| 354 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
| 355 | if(self.Usable or overrideUsable)then | |
| 356 | self.Usable = false | |
| 357 | self.CoolingDown = true | |
| 358 | local LastUse = time() | |
| 359 | self.LastUse = LastUse | |
| 360 | delay(self.Cooldown or 2,function() | |
| 361 | if(self.LastUse == LastUse)then | |
| 362 | self.CoolingDown = false | |
| 363 | self.Usable = true | |
| 364 | end | |
| 365 | end) | |
| 366 | end | |
| 367 | end | |
| 368 | ||
| 369 | function Debounces:Get(name) | |
| 370 | assert(typeof(name) == 'string',("bad argument #1 to 'get' (string expected, got %s)"):format(typeof(name) == nil and "no value" or typeof(name)))
| |
| 371 | for i,v in next, Debounces.Debounces do | |
| 372 | if(i == name)then | |
| 373 | return v; | |
| 374 | end | |
| 375 | end | |
| 376 | end | |
| 377 | ||
| 378 | function Debounces:GetProgressPercentage() | |
| 379 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
| 380 | if(self.CoolingDown and not self.Usable)then | |
| 381 | return math.max( | |
| 382 | math.floor( | |
| 383 | ( | |
| 384 | (time()-self.LastUse)/self.Cooldown or 2 | |
| 385 | )*100 | |
| 386 | ) | |
| 387 | ) | |
| 388 | else | |
| 389 | return 100 | |
| 390 | end | |
| 391 | end | |
| 392 | ||
| 393 | --// Instance Creation Functions \\-- | |
| 394 | local baseSound = IN("Sound")
| |
| 395 | function Sound(parent,id,pitch,volume,looped,effect,autoPlay) | |
| 396 | local Sound = baseSound:Clone() | |
| 397 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
| 398 | Sound.Pitch = pitch or 1 | |
| 399 | Sound.Volume = volume or 1 | |
| 400 | Sound.Looped = looped or false | |
| 401 | if(autoPlay)then | |
| 402 | coroutine.wrap(function() | |
| 403 | repeat wait() until Sound.IsLoaded | |
| 404 | Sound.Playing = autoPlay or false | |
| 405 | end)() | |
| 406 | end | |
| 407 | if(not looped and effect)then | |
| 408 | Sound.Stopped:connect(function() | |
| 409 | Sound.Volume = 0 | |
| 410 | Sound:destroy() | |
| 411 | end) | |
| 412 | elseif(effect)then | |
| 413 | warn("Sound can't be looped and a sound effect!")
| |
| 414 | end | |
| 415 | Sound.Parent =parent or Torso | |
| 416 | return Sound | |
| 417 | end | |
| 418 | function Part(parent,color,material,size,cframe,anchored,cancollide) | |
| 419 | local part = IN("Part")
| |
| 420 | part.Parent = parent or Char | |
| 421 | part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0) | |
| 422 | part.Material = material or Enum.Material.SmoothPlastic | |
| 423 | part.TopSurface,part.BottomSurface=10,10 | |
| 424 | part.Size = size or V3.N(1,1,1) | |
| 425 | part.CFrame = cframe or CF.N(0,0,0) | |
| 426 | part.CanCollide = cancollide or false | |
| 427 | part.Anchored = anchored or false | |
| 428 | return part | |
| 429 | end | |
| 430 | ||
| 431 | function Weld(part0,part1,c0,c1) | |
| 432 | local weld = IN("Weld")
| |
| 433 | weld.Parent = part0 | |
| 434 | weld.Part0 = part0 | |
| 435 | weld.Part1 = part1 | |
| 436 | weld.C0 = c0 or CF.N() | |
| 437 | weld.C1 = c1 or CF.N() | |
| 438 | return weld | |
| 439 | end | |
| 440 | ||
| 441 | function Mesh(parent,meshtype,meshid,textid,scale,offset) | |
| 442 | local part = IN("SpecialMesh")
| |
| 443 | part.MeshId = meshid or "" | |
| 444 | part.TextureId = textid or "" | |
| 445 | part.Scale = scale or V3.N(1,1,1) | |
| 446 | part.Offset = offset or V3.N(0,0,0) | |
| 447 | part.MeshType = meshtype or Enum.MeshType.Sphere | |
| 448 | part.Parent = parent | |
| 449 | return part | |
| 450 | end | |
| 451 | ||
| 452 | NewInstance = function(instance,parent,properties) | |
| 453 | local inst = Instance.new(instance) | |
| 454 | inst.Parent = parent | |
| 455 | if(properties)then | |
| 456 | for i,v in next, properties do | |
| 457 | pcall(function() inst[i] = v end) | |
| 458 | end | |
| 459 | end | |
| 460 | return inst; | |
| 461 | end | |
| 462 | ||
| 463 | function Clone(instance,parent,properties) | |
| 464 | local inst = instance:Clone() | |
| 465 | inst.Parent = parent | |
| 466 | if(properties)then | |
| 467 | for i,v in next, properties do | |
| 468 | pcall(function() inst[i] = v end) | |
| 469 | end | |
| 470 | end | |
| 471 | return inst; | |
| 472 | end | |
| 473 | ||
| 474 | function SoundPart(id,pitch,volume,looped,effect,autoPlay,cf) | |
| 475 | local soundPart = NewInstance("Part",Effects,{Transparency=1,CFrame=cf or Torso.CFrame,Anchored=true,CanCollide=false,Size=V3.N()})
| |
| 476 | local Sound = IN("Sound")
| |
| 477 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
| 478 | Sound.Pitch = pitch or 1 | |
| 479 | Sound.Volume = volume or 1 | |
| 480 | Sound.Looped = looped or false | |
| 481 | if(autoPlay)then | |
| 482 | coroutine.wrap(function() | |
| 483 | repeat wait() until Sound.IsLoaded | |
| 484 | Sound.Playing = autoPlay or false | |
| 485 | end)() | |
| 486 | end | |
| 487 | if(not looped and effect)then | |
| 488 | Sound.Stopped:connect(function() | |
| 489 | Sound.Volume = 0 | |
| 490 | soundPart:destroy() | |
| 491 | end) | |
| 492 | elseif(effect)then | |
| 493 | warn("Sound can't be looped and a sound effect!")
| |
| 494 | end | |
| 495 | Sound.Parent = soundPart | |
| 496 | return Sound | |
| 497 | end | |
| 498 | ||
| 499 | ||
| 500 | --// Extended ROBLOX tables \\-- | |
| 501 | local Instance = setmetatable({ClearChildrenOfClass = function(where,class,recursive) local children = (recursive and where:GetDescendants() or where:GetChildren()) for _,v in next, children do if(v:IsA(class))then v:destroy();end;end;end},{__index = Instance})
| |
| 502 | --// Require stuff \\-- | |
| 503 | function CamShake(who,times,intense,origin) | |
| 504 | coroutine.wrap(function() | |
| 505 | if(script:FindFirstChild'CamShake')then | |
| 506 | local cam = script.CamShake:Clone() | |
| 507 | cam:WaitForChild'intensity'.Value = intense | |
| 508 | cam:WaitForChild'times'.Value = times | |
| 509 | ||
| 510 | if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end
| |
| 511 | cam.Parent = who | |
| 512 | wait() | |
| 513 | cam.Disabled = false | |
| 514 | elseif(who == Plr or who == Char or who:IsDescendantOf(Plr))then | |
| 515 | local intensity = intense | |
| 516 | if(Hum and not Hum:FindFirstChild'CamShaking')then | |
| 517 | local cam = workspace.CurrentCamera | |
| 518 | local oCO = Hum.CameraOffset | |
| 519 | local cs = Instance.new("BoolValue",Hum)
| |
| 520 | cs.Name = "CamShaking" | |
| 521 | for i = 1, times do | |
| 522 | local camDistFromOrigin | |
| 523 | if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then | |
| 524 | camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin.Position).magnitude )/25 | |
| 525 | elseif(typeof(origin) == 'Vector3')then | |
| 526 | camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin).magnitude )/25 | |
| 527 | end | |
| 528 | if(camDistFromOrigin)then | |
| 529 | intensity = math.min(intense, math.floor(intense/camDistFromOrigin)) | |
| 530 | end | |
| 531 | --cam.CoordinateFrame = cam.CoordinateFrame*CFrame.fromEulerAnglesXYZ(math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200) | |
| 532 | if(Hum)then | |
| 533 | Hum.CameraOffset = Vector3.new(math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200) | |
| 534 | end | |
| 535 | swait() | |
| 536 | end | |
| 537 | if(Hum)then | |
| 538 | Hum.CameraOffset = oCO | |
| 539 | end | |
| 540 | cs:destroy() | |
| 541 | end | |
| 542 | end | |
| 543 | end)() | |
| 544 | end | |
| 545 | ||
| 546 | ||
| 547 | function CamShakeAll(times,intense,origin) | |
| 548 | for _,v in next, Plrs:players() do | |
| 549 | CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin) | |
| 550 | end | |
| 551 | end | |
| 552 | ||
| 553 | function ServerScript(code) | |
| 554 | if(script:FindFirstChild'Loadstring')then | |
| 555 | local load = script.Loadstring:Clone() | |
| 556 | load:WaitForChild'Sauce'.Value = code | |
| 557 | load.Disabled = false | |
| 558 | load.Parent = workspace | |
| 559 | elseif(NS and typeof(NS) == 'function')then | |
| 560 | NS(code,workspace) | |
| 561 | else | |
| 562 | warn("no serverscripts lol")
| |
| 563 | end | |
| 564 | end | |
| 565 | ||
| 566 | function LocalOnPlayer(who,code) | |
| 567 | ServerScript([[ | |
| 568 | wait() | |
| 569 | script.Parent=nil | |
| 570 | if(not _G.Http)then _G.Http = game:service'HttpService' end | |
| 571 | ||
| 572 | local Http = _G.Http or game:service'HttpService' | |
| 573 | ||
| 574 | local source = ]].."[["..code.."]]"..[[ | |
| 575 | local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php" | |
| 576 | local asd = Http:PostAsync(link,source) | |
| 577 | repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID | |
| 578 | local ID = Http:JSONDecode(asd).Result.Require_ID | |
| 579 | local vs = require(ID).VORTH_SCRIPT | |
| 580 | vs.Parent = game:service'Players'.]]..who.Name..[[.Character | |
| 581 | ]]) | |
| 582 | end | |
| 583 | ||
| 584 | ||
| 585 | --// Customization \\-- | |
| 586 | ||
| 587 | local Frame_Speed = 200 -- The frame speed for swait. 1 is automatically divided by this | |
| 588 | local Remove_Hats = true | |
| 589 | local Remove_Clothing = true | |
| 590 | local PlayerSize = 3 | |
| 591 | local DamageColor = BrickColor.new'Really red' | |
| 592 | local MusicID = 2269011765 | |
| 593 | local God = false | |
| 594 | local Muted = false | |
| 595 | local angerCounter = 8; -- lower = faster | |
| 596 | local angry = false | |
| 597 | ||
| 598 | local WalkSpeed = 16 | |
| 599 | ||
| 600 | --// Weapon and GUI creation, and Character Customization \\-- | |
| 601 | ||
| 602 | if(Remove_Hats)then Instance.ClearChildrenOfClass(Char,"Accessory",true) end | |
| 603 | if(Remove_Clothing)then Instance.ClearChildrenOfClass(Char,"Clothing",true) Instance.ClearChildrenOfClass(Char,"ShirtGraphic",true) end | |
| 604 | ||
| 605 | local rule = Part(Char,BrickColor.new'Linen',Enum.Material.Wood,V3.N(.2,.5,4),CF.N(),false,false) | |
| 606 | local rd = NewInstance("Decal",rule,{Texture='rbxassetid://109519158',Face='Right'})
| |
| 607 | local ld = NewInstance("Decal",rule,{Texture='rbxassetid://109519158',Face='Left'})
| |
| 608 | ||
| 609 | if(PlayerSize ~= 1)then | |
| 610 | for _,v in next, Char:GetDescendants() do | |
| 611 | if(v:IsA'BasePart')then | |
| 612 | v.Size = v.Size * PlayerSize | |
| 613 | end | |
| 614 | end | |
| 615 | end | |
| 616 | ||
| 617 | ||
| 618 | local Music = Sound(Char,MusicID,1,3,true,false,true) | |
| 619 | Music.Name = 'Music' | |
| 620 | ||
| 621 | --// Stop animations \\-- | |
| 622 | for _,v in next, Hum:GetPlayingAnimationTracks() do | |
| 623 | v:Stop(); | |
| 624 | end | |
| 625 | ||
| 626 | pcall(game.Destroy,Char:FindFirstChild'Animate') | |
| 627 | pcall(game.Destroy,Hum:FindFirstChild'Animator') | |
| 628 | ||
| 629 | --// Joints \\-- | |
| 630 | ||
| 631 | local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
| |
| 632 | local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.1 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)})
| |
| 633 | local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5 * PlayerSize,0)})
| |
| 634 | local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
| |
| 635 | local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)})
| |
| 636 | local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso})
| |
| 637 | local HW = NewInstance('Motor',Char,{Part0=RArm,Part1=rule,C0=CF.N(0,-1,-1)})
| |
| 638 | ||
| 639 | local LSC0 = LS.C0 | |
| 640 | local RSC0 = RS.C0 | |
| 641 | local NKC0 = NK.C0 | |
| 642 | local LHC0 = LH.C0 | |
| 643 | local RHC0 = RH.C0 | |
| 644 | local RJC0 = RJ.C0 | |
| 645 | ||
| 646 | --// Artificial HB \\-- | |
| 647 | ||
| 648 | local ArtificialHB = IN("BindableEvent", script)
| |
| 649 | ArtificialHB.Name = "Heartbeat" | |
| 650 | ||
| 651 | script:WaitForChild("Heartbeat")
| |
| 652 | ||
| 653 | local tf = 0 | |
| 654 | local allowframeloss = false | |
| 655 | local tossremainder = false | |
| 656 | local lastframe = tick() | |
| 657 | local frame = 1/Frame_Speed | |
| 658 | ArtificialHB:Fire() | |
| 659 | ||
| 660 | game:GetService("RunService").Heartbeat:connect(function(s, p)
| |
| 661 | tf = tf + s | |
| 662 | if tf >= frame then | |
| 663 | if allowframeloss then | |
| 664 | script.Heartbeat:Fire() | |
| 665 | lastframe = tick() | |
| 666 | else | |
| 667 | for i = 1, math.floor(tf / frame) do | |
| 668 | ArtificialHB:Fire() | |
| 669 | end | |
| 670 | lastframe = tick() | |
| 671 | end | |
| 672 | if tossremainder then | |
| 673 | tf = 0 | |
| 674 | else | |
| 675 | tf = tf - frame * math.floor(tf / frame) | |
| 676 | end | |
| 677 | end | |
| 678 | end) | |
| 679 | ||
| 680 | function swait(num) | |
| 681 | if num == 0 or num == nil then | |
| 682 | ArtificialHB.Event:wait() | |
| 683 | else | |
| 684 | for i = 0, num do | |
| 685 | ArtificialHB.Event:wait() | |
| 686 | end | |
| 687 | end | |
| 688 | end | |
| 689 | ||
| 690 | ||
| 691 | --// Effect Function(s) \\-- | |
| 692 | ||
| 693 | function NoobySphere(Lifetime,Speed,Type,Pos,StartSize,Inc,Color,Range,MeshId,Axis) | |
| 694 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos+Pos.lookVector*Range,true,false) | |
| 695 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Sphere),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
| 696 | local Scale = 1 | |
| 697 | local speeder = Speed | |
| 698 | if(Type == "Multiply")then | |
| 699 | Scale = 1*Inc | |
| 700 | elseif(Type == "Divide")then | |
| 701 | Scale = 1/Inc | |
| 702 | end | |
| 703 | coroutine.wrap(function() | |
| 704 | for i = 0,10/Lifetime,.1 do | |
| 705 | ||
| 706 | if(Type == "Multiply")then | |
| 707 | Scale = Scale - 0.01*Inc/Lifetime | |
| 708 | elseif(Type == "Divide")then | |
| 709 | Scale = Scale - 0.01/Inc*Lifetime | |
| 710 | end | |
| 711 | speeder = speeder - 0.01*Speed*Lifetime | |
| 712 | fxP.CFrame = fxP.CFrame + fxP.CFrame.lookVector*speeder*Lifetime | |
| 713 | fxP.Transparency = fxP.Transparency + 0.01*Lifetime | |
| 714 | if(Axis == 'x')then | |
| 715 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, 0, 0) | |
| 716 | elseif(Axis == 'y')then | |
| 717 | fxM.Scale = fxM.Scale + Vector3.new(0, Scale*Lifetime, 0) | |
| 718 | elseif(Axis == 'z')then | |
| 719 | fxM.Scale = fxM.Scale + Vector3.new(0, 0, Scale*Lifetime) | |
| 720 | elseif(Axis == 'xyz')then | |
| 721 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime,Scale*Lifetime,Scale*Lifetime) | |
| 722 | elseif(Axis == 'yz')then | |
| 723 | fxM.Scale = fxM.Scale + Vector3.new(0,Scale*Lifetime,Scale*Lifetime) | |
| 724 | elseif(Axis == 'xz')then | |
| 725 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime,0,Scale*Lifetime) | |
| 726 | else | |
| 727 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, Scale*Lifetime, 0) | |
| 728 | end | |
| 729 | if(fxP.Transparency >= 1)then break end | |
| 730 | swait() | |
| 731 | end | |
| 732 | fxP:destroy() | |
| 733 | end)() | |
| 734 | return fxP | |
| 735 | end | |
| 736 | ||
| 737 | function NoobySphere2(Lifetime,Type,Pos,StartSize,Inc,Color,MeshId) | |
| 738 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos,true,false) | |
| 739 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Sphere),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
| 740 | ||
| 741 | local Scale = 1 | |
| 742 | if(Type == "Multiply")then | |
| 743 | Scale = 1*Inc | |
| 744 | elseif(Type == "Divide")then | |
| 745 | Scale = 1/Inc | |
| 746 | end | |
| 747 | coroutine.wrap(function() | |
| 748 | for i = 0,10/Lifetime,.1 do | |
| 749 | ||
| 750 | if(Type == "Multiply")then | |
| 751 | Scale = Scale - 0.01*Inc/Lifetime | |
| 752 | elseif(Type == "Divide")then | |
| 753 | Scale = Scale - 0.01/Inc*Lifetime | |
| 754 | end | |
| 755 | fxP.Transparency = fxP.Transparency + 0.01*Lifetime | |
| 756 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, Scale*Lifetime, Scale*Lifetime) | |
| 757 | swait() | |
| 758 | end | |
| 759 | fxP:destroy() | |
| 760 | end)() | |
| 761 | end | |
| 762 | ||
| 763 | function NoobyBlock(Lifetime,Speed,Type,Pos,StartSize,Inc,Color,Range,Fade,MeshId) | |
| 764 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos+Pos.lookVector*Range,true,false) | |
| 765 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Brick),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
| 766 | local Scale = 1 | |
| 767 | local speeder = Speed | |
| 768 | if(Type == "Multiply")then | |
| 769 | Scale = 1*Inc | |
| 770 | elseif(Type == "Divide")then | |
| 771 | Scale = 1/Inc | |
| 772 | end | |
| 773 | coroutine.wrap(function() | |
| 774 | for i = 0,10/Lifetime,.1 do | |
| 775 | if(Type == "Multiply")then | |
| 776 | Scale = Scale - 0.01*Inc/Lifetime | |
| 777 | elseif(Type == "Divide")then | |
| 778 | Scale = Scale - 0.01/Inc*Lifetime | |
| 779 | end | |
| 780 | if(Fade)then | |
| 781 | fxP.Transparency = i/(10/Lifetime) | |
| 782 | end | |
| 783 | speeder = speeder - 0.01*Speed*Lifetime/10 | |
| 784 | fxP.CFrame = fxP.CFrame + fxP.CFrame.lookVector*speeder*Lifetime | |
| 785 | fxM.Scale = fxM.Scale - Vector3.new(Scale*Lifetime, Scale*Lifetime, Scale*Lifetime) | |
| 786 | swait() | |
| 787 | end | |
| 788 | fxP:destroy() | |
| 789 | end)() | |
| 790 | end | |
| 791 | ||
| 792 | function Bezier(startpos, pos2, pos3, endpos, t) | |
| 793 | local A = startpos:lerp(pos2, t) | |
| 794 | local B = pos2:lerp(pos3, t) | |
| 795 | local C = pos3:lerp(endpos, t) | |
| 796 | local lerp1 = A:lerp(B, t) | |
| 797 | local lerp2 = B:lerp(C, t) | |
| 798 | local cubic = lerp1:lerp(lerp2, t) | |
| 799 | return cubic | |
| 800 | end | |
| 801 | function Puddle(hit,pos,norm,data) | |
| 802 | local material = data.Material or Enum.Material.SmoothPlastic | |
| 803 | local color = data.Color or BrickColor.new'Crimson' | |
| 804 | local size = data.Size or 1 | |
| 805 | ||
| 806 | if(hit.Name ~= 'BloodPuddle')then | |
| 807 | local Puddle = NewInstance('Part',workspace,{Material=material,BrickColor=color,Size=V3.N(size,.1,size),CFrame=CF.N(pos,pos+norm)*CF.A(90*M.P/180,0,0),Anchored=true,CanCollide=false,Archivable=false,Locked=true,Name='BloodPuddle'})
| |
| 808 | local Cyl = NewInstance('CylinderMesh',Puddle,{Name='CylinderMesh'})
| |
| 809 | BloodPuddles[Puddle] = 0 | |
| 810 | else | |
| 811 | local cyl = hit:FindFirstChild'CylinderMesh' | |
| 812 | if(cyl)then | |
| 813 | BloodPuddles[hit] = 0 | |
| 814 | cyl.Scale = cyl.Scale + V3.N(size,0,size) | |
| 815 | hit.Transparency = 0 | |
| 816 | end | |
| 817 | end | |
| 818 | end | |
| 819 | ||
| 820 | function Droplet(data) | |
| 821 | --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10}
| |
| 822 | local Size = data.Size or 1 | |
| 823 | local Color = data.Color or BrickColor.new'Crimson' | |
| 824 | local StudsPerFrame = data.Speed or 1 | |
| 825 | local Shape = data.Shape or 'Ball' | |
| 826 | local Frames = (data.Frames or 160)+1 | |
| 827 | local Pos = data.Origin or Root.CFrame | |
| 828 | local Direction = data.Direction or Root.CFrame.lookVector*100000 | |
| 829 | local Material = data.Material or Enum.Material.SmoothPlastic | |
| 830 | local Drop = data.Drop or .05 | |
| 831 | local Ignorelist = data.Ignorelist or nil | |
| 832 | ||
| 833 | local Bullet = Part(Effects,Color,Material,V3.N(Size,Size,Size),Pos,true,false) | |
| 834 | local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N()) | |
| 835 | if(Shape == 'Ball')then | |
| 836 | BMesh.MeshType = Enum.MeshType.Sphere | |
| 837 | elseif(Shape == 'Head')then | |
| 838 | BMesh.MeshType = Enum.MeshType.Head | |
| 839 | elseif(Shape == 'Cylinder')then | |
| 840 | BMesh.MeshType = Enum.MeshType.Cylinder | |
| 841 | end | |
| 842 | ||
| 843 | coroutine.wrap(function() | |
| 844 | for i = 1, Frames do | |
| 845 | Pos = Pos * CF.N(0,-(Drop*i),0) | |
| 846 | local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i)).p,StudsPerFrame) | |
| 847 | if(hit and (not hit.Parent or not hit.Parent:FindFirstChildOfClass'Humanoid' and not hit.Parent:IsA'Accessory'))then | |
| 848 | Puddle(hit,pos,norm,data) | |
| 849 | break; | |
| 850 | else | |
| 851 | Bullet.CFrame = CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i)) | |
| 852 | end | |
| 853 | swait() | |
| 854 | end | |
| 855 | Bullet:destroy() | |
| 856 | end)() | |
| 857 | end | |
| 858 | ||
| 859 | function SphereFX(duration,color,scale,pos,endScale,increment) | |
| 860 | return Effect{
| |
| 861 | Effect='ResizeAndFade', | |
| 862 | Color=color, | |
| 863 | Size=scale, | |
| 864 | Mesh={MeshType=Enum.MeshType.Sphere},
| |
| 865 | CFrame=pos, | |
| 866 | FXSettings={
| |
| 867 | EndSize=endScale, | |
| 868 | EndIsIncrement=increment | |
| 869 | } | |
| 870 | } | |
| 871 | end | |
| 872 | ||
| 873 | function BlastFX(duration,color,scale,pos,endScale,increment) | |
| 874 | return Effect{
| |
| 875 | Effect='ResizeAndFade', | |
| 876 | Color=color, | |
| 877 | Size=scale, | |
| 878 | Mesh={MeshType=Enum.MeshType.FileMesh,MeshId='rbxassetid://20329976'},
| |
| 879 | CFrame=pos, | |
| 880 | FXSettings={
| |
| 881 | EndSize=endScale, | |
| 882 | EndIsIncrement=increment | |
| 883 | } | |
| 884 | } | |
| 885 | end | |
| 886 | ||
| 887 | function BlockFX(duration,color,scale,pos,endScale,increment) | |
| 888 | return Effect{
| |
| 889 | Effect='ResizeAndFade', | |
| 890 | Color=color, | |
| 891 | Size=scale, | |
| 892 | CFrame=pos, | |
| 893 | FXSettings={
| |
| 894 | EndSize=endScale, | |
| 895 | EndIsIncrement=increment | |
| 896 | } | |
| 897 | } | |
| 898 | end | |
| 899 | ||
| 900 | function ShootBullet(data) | |
| 901 | --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10}
| |
| 902 | local Size = data.Size or V3.N(2,2,2) | |
| 903 | local Color = data.Color or BrickColor.new'Crimson' | |
| 904 | local StudsPerFrame = data.Speed or 10 | |
| 905 | local Shape = data.Shape or 'Ball' | |
| 906 | local Frames = data.Frames or 160 | |
| 907 | local Pos = data.Origin or Torso.CFrame | |
| 908 | local Direction = data.Direction or Mouse.Hit | |
| 909 | local Material = data.Material or Enum.Material.Neon | |
| 910 | local OnHit = data.HitFunction or function(hit,pos) | |
| 911 | Effect{
| |
| 912 | Effect='ResizeAndFade', | |
| 913 | Color=Color, | |
| 914 | Size=V3.N(10,10,10), | |
| 915 | Mesh={MeshType=Enum.MeshType.Sphere},
| |
| 916 | CFrame=CF.N(pos), | |
| 917 | FXSettings={
| |
| 918 | EndSize=V3.N(.05,.05,.05), | |
| 919 | EndIsIncrement=true | |
| 920 | } | |
| 921 | } | |
| 922 | for i = 1, 5 do | |
| 923 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
| 924 | Effect{
| |
| 925 | Effect='Fade', | |
| 926 | Frames=65, | |
| 927 | Size=V3.N(5,5,10), | |
| 928 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-10).p,pos), | |
| 929 | Mesh = {MeshType=Enum.MeshType.Sphere},
| |
| 930 | Material=Enum.Material.Neon, | |
| 931 | Color=Color, | |
| 932 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
| 933 | } | |
| 934 | end | |
| 935 | end | |
| 936 | ||
| 937 | local Bullet = Part(Effects,Color,Material,Size,Pos,true,false) | |
| 938 | local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N()) | |
| 939 | if(Shape == 'Ball')then | |
| 940 | BMesh.MeshType = Enum.MeshType.Sphere | |
| 941 | elseif(Shape == 'Head')then | |
| 942 | BMesh.MeshType = Enum.MeshType.Head | |
| 943 | elseif(Shape == 'Cylinder')then | |
| 944 | BMesh.MeshType = Enum.MeshType.Cylinder | |
| 945 | end | |
| 946 | ||
| 947 | coroutine.wrap(function() | |
| 948 | for i = 1, Frames+1 do | |
| 949 | local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame).p,StudsPerFrame) | |
| 950 | if(hit)then | |
| 951 | OnHit(hit,pos,norm,dist) | |
| 952 | break; | |
| 953 | else | |
| 954 | Bullet.CFrame = CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame) | |
| 955 | end | |
| 956 | swait() | |
| 957 | end | |
| 958 | Bullet:destroy() | |
| 959 | end)() | |
| 960 | ||
| 961 | end | |
| 962 | ||
| 963 | ||
| 964 | function Zap(data) | |
| 965 | local sCF,eCF = data.StartCFrame,data.EndCFrame | |
| 966 | assert(sCF,"You need a start CFrame!") | |
| 967 | assert(eCF,"You need an end CFrame!") | |
| 968 | local parts = data.PartCount or 15 | |
| 969 | local zapRot = data.ZapRotation or {-5,5}
| |
| 970 | local startThick = data.StartSize or 3; | |
| 971 | local endThick = data.EndSize or startThick/2; | |
| 972 | local color = data.Color or BrickColor.new'Electric blue' | |
| 973 | local delay = data.Delay or 35 | |
| 974 | local delayInc = data.DelayInc or 0 | |
| 975 | local lastLightning; | |
| 976 | local MagZ = (sCF.p - eCF.p).magnitude | |
| 977 | local thick = startThick | |
| 978 | local inc = (startThick/parts)-(endThick/parts) | |
| 979 | ||
| 980 | for i = 1, parts do | |
| 981 | local pos = sCF.p | |
| 982 | if(lastLightning)then | |
| 983 | pos = lastLightning.CFrame*CF.N(0,0,MagZ/parts/2).p | |
| 984 | end | |
| 985 | delay = delay + delayInc | |
| 986 | local zapPart = Part(Effects,color,Enum.Material.Neon,V3.N(thick,thick,MagZ/parts),CF.N(pos),true,false) | |
| 987 | local posie = CF.N(pos,eCF.p)*CF.N(0,0,MagZ/parts).p+V3.N(M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot))) | |
| 988 | if(parts == i)then | |
| 989 | local MagZ = (pos-eCF.p).magnitude | |
| 990 | zapPart.Size = V3.N(endThick,endThick,MagZ) | |
| 991 | zapPart.CFrame = CF.N(pos, eCF.p)*CF.N(0,0,-MagZ/2) | |
| 992 | Effect{Effect='ResizeAndFade',Size=V3.N(thick,thick,thick),CFrame=eCF*CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)),Color=color,Frames=delay*2,FXSettings={EndSize=V3.N(thick*8,thick*8,thick*8)}}
| |
| 993 | else | |
| 994 | zapPart.CFrame = CF.N(pos,posie)*CF.N(0,0,MagZ/parts/2) | |
| 995 | end | |
| 996 | ||
| 997 | lastLightning = zapPart | |
| 998 | Effect{Effect='Fade',Manual=zapPart,Frames=delay}
| |
| 999 | ||
| 1000 | thick=thick-inc | |
| 1001 | ||
| 1002 | end | |
| 1003 | end | |
| 1004 | ||
| 1005 | function Zap2(data) | |
| 1006 | local Color = data.Color or BrickColor.new'Electric blue' | |
| 1007 | local StartPos = data.Start or Torso.Position | |
| 1008 | local EndPos = data.End or Mouse.Hit.p | |
| 1009 | local SegLength = data.SegL or 2 | |
| 1010 | local Thicc = data.Thickness or 0.5 | |
| 1011 | local Fades = data.Fade or 45 | |
| 1012 | local Parent = data.Parent or Effects | |
| 1013 | local MaxD = data.MaxDist or 200 | |
| 1014 | local Branch = data.Branches or false | |
| 1015 | local Material = data.Material or Enum.Material.Neon | |
| 1016 | local Raycasts = data.Raycasts or false | |
| 1017 | local Offset = data.Offset or {0,360}
| |
| 1018 | local AddMesh = (data.Mesh == nil and true or data.Mesh) | |
| 1019 | if((StartPos-EndPos).magnitude > MaxD)then | |
| 1020 | EndPos = CF.N(StartPos,EndPos)*CF.N(0,0,-MaxD).p | |
| 1021 | end | |
| 1022 | local hit,pos,norm,dist=nil,EndPos,nil,(StartPos-EndPos).magnitude | |
| 1023 | if(Raycasts)then | |
| 1024 | hit,pos,norm,dist = CastRay(StartPos,EndPos,MaxD) | |
| 1025 | end | |
| 1026 | local segments = dist/SegLength | |
| 1027 | local model = IN("Model",Parent)
| |
| 1028 | model.Name = 'Lightning' | |
| 1029 | local Last; | |
| 1030 | for i = 1, segments do | |
| 1031 | local size = (segments-i)/25 | |
| 1032 | local prt = Part(model,Color,Material,V3.N(Thicc+size,SegLength,Thicc+size),CF.N(),true,false) | |
| 1033 | if(AddMesh)then IN("CylinderMesh",prt) end
| |
| 1034 | if(Last and math.floor(segments) == i)then | |
| 1035 | local MagZ = (Last.CFrame*CF.N(0,-SegLength/2,0).p-EndPos).magnitude | |
| 1036 | prt.Size = V3.N(Thicc+size,MagZ,Thicc+size) | |
| 1037 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,EndPos)*CF.A(M.R(90),0,0)*CF.N(0,-MagZ/2,0) | |
| 1038 | elseif(not Last)then | |
| 1039 | prt.CFrame = CF.N(StartPos,pos)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
| 1040 | else | |
| 1041 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,CF.N(pos)*CF.A(M.R(M.RNG(0,360)),M.R(M.RNG(0,360)),M.R(M.RNG(0,360)))*CF.N(0,0,SegLength/3+(segments-i)).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
| 1042 | end | |
| 1043 | Last = prt | |
| 1044 | if(Branch)then | |
| 1045 | local choice = M.RNG(1,7+((segments-i)*2)) | |
| 1046 | if(choice == 1)then | |
| 1047 | local LastB; | |
| 1048 | for i2 = 1,M.RNG(2,5) do | |
| 1049 | local size2 = ((segments-i)/35)/i2 | |
| 1050 | local prt = Part(model,Color,Material,V3.N(Thicc+size2,SegLength,Thicc+size2),CF.N(),true,false) | |
| 1051 | if(AddMesh)then IN("CylinderMesh",prt) end
| |
| 1052 | if(not LastB)then | |
| 1053 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,Last.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
| 1054 | else | |
| 1055 | prt.CFrame = CF.N(LastB.CFrame*CF.N(0,-SegLength/2,0).p,LastB.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
| 1056 | end | |
| 1057 | LastB = prt | |
| 1058 | end | |
| 1059 | end | |
| 1060 | end | |
| 1061 | end | |
| 1062 | if(Fades > 0)then | |
| 1063 | coroutine.wrap(function() | |
| 1064 | for i = 1, Fades do | |
| 1065 | for _,v in next, model:children() do | |
| 1066 | if(v:IsA'BasePart')then | |
| 1067 | v.Transparency = (i/Fades) | |
| 1068 | end | |
| 1069 | end | |
| 1070 | swait() | |
| 1071 | end | |
| 1072 | model:destroy() | |
| 1073 | end)() | |
| 1074 | else | |
| 1075 | S.Debris:AddItem(model,.01) | |
| 1076 | end | |
| 1077 | return {End=(Last and Last.CFrame*CF.N(0,-Last.Size.Y/2,0).p),Last=Last,Model=model}
| |
| 1078 | end | |
| 1079 | ||
| 1080 | function Tween(obj,props,time,easing,direction,repeats,backwards) | |
| 1081 | local info = TweenInfo.new(time or .5, easing or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out, repeats or 0, backwards or false) | |
| 1082 | local tween = S.TweenService:Create(obj, info, props) | |
| 1083 | ||
| 1084 | tween:Play() | |
| 1085 | end | |
| 1086 | ||
| 1087 | function Effect(data) | |
| 1088 | local FX = data.Effect or 'ResizeAndFade' | |
| 1089 | local Parent = data.Parent or Effects | |
| 1090 | local Color = data.Color or C3.N(0,0,0) | |
| 1091 | local Size = data.Size or V3.N(1,1,1) | |
| 1092 | local MoveDir = data.MoveDirection or nil | |
| 1093 | local MeshData = data.Mesh or nil | |
| 1094 | local SndData = data.Sound or nil | |
| 1095 | local Frames = data.Frames or 45 | |
| 1096 | local Manual = data.Manual or nil | |
| 1097 | local Material = data.Material or nil | |
| 1098 | local CFra = data.CFrame or Torso.CFrame | |
| 1099 | local Settings = data.FXSettings or {}
| |
| 1100 | local Shape = data.Shape or Enum.PartType.Block | |
| 1101 | local Snd,Prt,Msh; | |
| 1102 | local RotInc = data.RotInc or {0,0,0}
| |
| 1103 | if(typeof(RotInc) == 'number')then | |
| 1104 | RotInc = {RotInc,RotInc,RotInc}
| |
| 1105 | end | |
| 1106 | coroutine.wrap(function() | |
| 1107 | if(Manual and typeof(Manual) == 'Instance' and Manual:IsA'BasePart')then | |
| 1108 | Prt = Manual | |
| 1109 | else | |
| 1110 | Prt = Part(Parent,Color,Material,Size,CFra,true,false) | |
| 1111 | Prt.Shape = Shape | |
| 1112 | end | |
| 1113 | if(typeof(MeshData) == 'table')then | |
| 1114 | Msh = Mesh(Prt,MeshData.MeshType,MeshData.MeshId,MeshData.TextureId,MeshData.Scale,MeshData.Offset) | |
| 1115 | elseif(typeof(MeshData) == 'Instance')then | |
| 1116 | Msh = MeshData:Clone() | |
| 1117 | Msh.Parent = Prt | |
| 1118 | elseif(Shape == Enum.PartType.Block)then | |
| 1119 | Msh = Mesh(Prt,Enum.MeshType.Brick) | |
| 1120 | end | |
| 1121 | if(typeof(SndData) == 'table' or typeof(SndData) == 'Instance')then | |
| 1122 | Snd = Sound(Prt,SndData.SoundId,SndData.Pitch,SndData.Volume,false,false,true) | |
| 1123 | end | |
| 1124 | if(Snd)then | |
| 1125 | repeat swait() until Snd.Playing and Snd.IsLoaded and Snd.TimeLength > 0 | |
| 1126 | Frames = Snd.TimeLength * Frame_Speed/Snd.Pitch | |
| 1127 | end | |
| 1128 | Size = (Msh and Msh.Scale or Size) | |
| 1129 | local grow = Size-(Settings.EndSize or (Msh and Msh.Scale or Size)/2) | |
| 1130 | ||
| 1131 | local MoveSpeed = nil; | |
| 1132 | if(MoveDir)then | |
| 1133 | MoveSpeed = (CFra.p - MoveDir).magnitude/Frames | |
| 1134 | end | |
| 1135 | if(FX ~= 'Arc')then | |
| 1136 | for Frame = 1, Frames do | |
| 1137 | if(FX == "Fade")then | |
| 1138 | Prt.Transparency = (Frame/Frames) | |
| 1139 | elseif(FX == "Resize")then | |
| 1140 | if(not Settings.EndSize)then | |
| 1141 | Settings.EndSize = V3.N(0,0,0) | |
| 1142 | end | |
| 1143 | if(Settings.EndIsIncrement)then | |
| 1144 | if(Msh)then | |
| 1145 | Msh.Scale = Msh.Scale + Settings.EndSize | |
| 1146 | else | |
| 1147 | Prt.Size = Prt.Size + Settings.EndSize | |
| 1148 | end | |
| 1149 | else | |
| 1150 | if(Msh)then | |
| 1151 | Msh.Scale = Msh.Scale - grow/Frames | |
| 1152 | else | |
| 1153 | Prt.Size = Prt.Size - grow/Frames | |
| 1154 | end | |
| 1155 | end | |
| 1156 | elseif(FX == "ResizeAndFade")then | |
| 1157 | if(not Settings.EndSize)then | |
| 1158 | Settings.EndSize = V3.N(0,0,0) | |
| 1159 | end | |
| 1160 | if(Settings.EndIsIncrement)then | |
| 1161 | if(Msh)then | |
| 1162 | Msh.Scale = Msh.Scale + Settings.EndSize | |
| 1163 | else | |
| 1164 | Prt.Size = Prt.Size + Settings.EndSize | |
| 1165 | end | |
| 1166 | else | |
| 1167 | if(Msh)then | |
| 1168 | Msh.Scale = Msh.Scale - grow/Frames | |
| 1169 | else | |
| 1170 | Prt.Size = Prt.Size - grow/Frames | |
| 1171 | end | |
| 1172 | end | |
| 1173 | Prt.Transparency = (Frame/Frames) | |
| 1174 | end | |
| 1175 | if(Settings.RandomizeCFrame)then | |
| 1176 | Prt.CFrame = Prt.CFrame * CF.A(M.RRNG(-360,360),M.RRNG(-360,360),M.RRNG(-360,360)) | |
| 1177 | else | |
| 1178 | Prt.CFrame = Prt.CFrame * CF.A(unpack(RotInc)) | |
| 1179 | end | |
| 1180 | if(MoveDir and MoveSpeed)then | |
| 1181 | local Orientation = Prt.Orientation | |
| 1182 | Prt.CFrame = CF.N(Prt.Position,MoveDir)*CF.N(0,0,-MoveSpeed) | |
| 1183 | Prt.Orientation = Orientation | |
| 1184 | end | |
| 1185 | swait() | |
| 1186 | end | |
| 1187 | Prt:destroy() | |
| 1188 | else | |
| 1189 | local start,third,fourth,endP = Settings.Start,Settings.Third,Settings.Fourth,Settings.End | |
| 1190 | if(not Settings.End and Settings.Home)then endP = Settings.Home.CFrame end | |
| 1191 | if(start and endP)then | |
| 1192 | local quarter = third or start:lerp(endP, 0.25) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
| 1193 | local threequarter = fourth or start:lerp(endP, 0.75) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
| 1194 | for Frame = 0, 1, (Settings.Speed or 0.01) do | |
| 1195 | if(Settings.Home)then | |
| 1196 | endP = Settings.Home.CFrame | |
| 1197 | end | |
| 1198 | Prt.CFrame = Bezier(start, quarter, threequarter, endP, Frame) | |
| 1199 | end | |
| 1200 | if(Settings.RemoveOnGoal)then | |
| 1201 | Prt:destroy() | |
| 1202 | end | |
| 1203 | else | |
| 1204 | Prt:destroy() | |
| 1205 | assert(start,"You need a start position!") | |
| 1206 | assert(endP,"You need a start position!") | |
| 1207 | end | |
| 1208 | end | |
| 1209 | end)() | |
| 1210 | return Prt,Msh,Snd | |
| 1211 | end | |
| 1212 | function SoulSteal(whom) | |
| 1213 | local torso = (whom:FindFirstChild'Head' or whom:FindFirstChild'Torso' or whom:FindFirstChild'UpperTorso' or whom:FindFirstChild'LowerTorso' or whom:FindFirstChild'HumanoidRootPart') | |
| 1214 | print(torso) | |
| 1215 | if(torso and torso:IsA'BasePart')then | |
| 1216 | local Model = Instance.new("Model",Effects)
| |
| 1217 | Model.Name = whom.Name.."'s Soul" | |
| 1218 | whom:BreakJoints() | |
| 1219 | local Soul = Part(Model,BrickColor.new'Really red','Glass',V3.N(.5,.5,.5),torso.CFrame,true,false) | |
| 1220 | Soul.Name = 'Head' | |
| 1221 | NewInstance("Humanoid",Model,{Health=0,MaxHealth=0})
| |
| 1222 | Effect{
| |
| 1223 | Effect="Arc", | |
| 1224 | Manual = Soul, | |
| 1225 | FXSettings={
| |
| 1226 | Start=torso.CFrame, | |
| 1227 | Home = Torso, | |
| 1228 | RemoveOnGoal = true, | |
| 1229 | } | |
| 1230 | } | |
| 1231 | local lastPoint = Soul.CFrame.p | |
| 1232 | ||
| 1233 | for i = 0, 1, 0.01 do | |
| 1234 | local point = CFrame.new(lastPoint, Soul.Position) * CFrame.Angles(-math.pi/2, 0, 0) | |
| 1235 | local mag = (lastPoint - Soul.Position).magnitude | |
| 1236 | Effect{
| |
| 1237 | Effect = "Fade", | |
| 1238 | CFrame = point * CF.N(0, mag/2, 0), | |
| 1239 | Size = V3.N(.5,mag+.5,.5), | |
| 1240 | Color = Soul.BrickColor | |
| 1241 | } | |
| 1242 | lastPoint = Soul.CFrame.p | |
| 1243 | swait() | |
| 1244 | end | |
| 1245 | for i = 1, 5 do | |
| 1246 | Effect{
| |
| 1247 | Effect="Fade", | |
| 1248 | Color = BrickColor.new'Really red', | |
| 1249 | MoveDirection = (Torso.CFrame*CFrame.new(M.RNG(-40,40),M.RNG(-40,40),M.RNG(-40,40))).p | |
| 1250 | } | |
| 1251 | end | |
| 1252 | end | |
| 1253 | end | |
| 1254 | ||
| 1255 | --// Other Functions \\ -- | |
| 1256 | ||
| 1257 | function CastRay(startPos,endPos,range,ignoreList) | |
| 1258 | local ray = Ray.new(startPos,(endPos-startPos).unit*range) | |
| 1259 | local part,pos,norm = workspace:FindPartOnRayWithIgnoreList(ray,ignoreList or {Char},false,true)
| |
| 1260 | return part,pos,norm,(pos and (startPos-pos).magnitude) | |
| 1261 | end | |
| 1262 | ||
| 1263 | function getRegion(point,range,ignore) | |
| 1264 | return workspace:FindPartsInRegion3WithIgnoreList(R3.N(point-V3.N(1,1,1)*range/2,point+V3.N(1,1,1)*range/2),ignore,100) | |
| 1265 | end | |
| 1266 | ||
| 1267 | function clerp(startCF,endCF,alpha) | |
| 1268 | return startCF:lerp(endCF, alpha) | |
| 1269 | end | |
| 1270 | ||
| 1271 | function GetTorso(char) | |
| 1272 | return char:FindFirstChild'Torso' or char:FindFirstChild'UpperTorso' or char:FindFirstChild'LowerTorso' or char:FindFirstChild'HumanoidRootPart' | |
| 1273 | end | |
| 1274 | ||
| 1275 | ||
| 1276 | function ShowDamage(Pos, Text, Time, Color) | |
| 1277 | coroutine.wrap(function() | |
| 1278 | local Rate = (1 / Frame_Speed) | |
| 1279 | local Pos = (Pos or Vector3.new(0, 0, 0)) | |
| 1280 | local Text = (Text or "") | |
| 1281 | local Time = (Time or 2) | |
| 1282 | local Color = (Color or Color3.new(1, 0, 1)) | |
| 1283 | local EffectPart = NewInstance("Part",Effects,{
| |
| 1284 | Material=Enum.Material.SmoothPlastic, | |
| 1285 | Reflectance = 0, | |
| 1286 | Transparency = 1, | |
| 1287 | BrickColor = BrickColor.new(Color), | |
| 1288 | Name = "Effect", | |
| 1289 | Size = Vector3.new(0,0,0), | |
| 1290 | Anchored = true, | |
| 1291 | CFrame = CF.N(Pos) | |
| 1292 | }) | |
| 1293 | local BillboardGui = NewInstance("BillboardGui",EffectPart,{
| |
| 1294 | Size = UDim2.new(1.25, 0, 1.25, 0), | |
| 1295 | Adornee = EffectPart, | |
| 1296 | }) | |
| 1297 | local TextLabel = NewInstance("TextLabel",BillboardGui,{
| |
| 1298 | BackgroundTransparency = 1, | |
| 1299 | Size = UDim2.new(1, 0, 1, 0), | |
| 1300 | Text = Text, | |
| 1301 | Font = "Bodoni", | |
| 1302 | TextColor3 = Color, | |
| 1303 | TextStrokeColor3 = Color3.new(0,0,0), | |
| 1304 | TextStrokeTransparency=0, | |
| 1305 | TextScaled = true, | |
| 1306 | }) | |
| 1307 | S.Debris:AddItem(EffectPart, (Time)) | |
| 1308 | EffectPart.Parent = workspace | |
| 1309 | delay(0, function() | |
| 1310 | Tween(EffectPart,{CFrame=CF.N(Pos)*CF.N(0,3,0)},Time,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out)
| |
| 1311 | local Frames = (Time / Rate) | |
| 1312 | for Frame = 1, Frames do | |
| 1313 | swait() | |
| 1314 | local Percent = (Frame / Frames) | |
| 1315 | TextLabel.TextTransparency = Percent | |
| 1316 | TextLabel.TextStrokeTransparency = Percent | |
| 1317 | end | |
| 1318 | if EffectPart and EffectPart.Parent then | |
| 1319 | EffectPart:Destroy() | |
| 1320 | end | |
| 1321 | end) end)() | |
| 1322 | end | |
| 1323 | ||
| 1324 | function DealDamage(data) | |
| 1325 | local Who = data.Who; | |
| 1326 | local MinDam = data.MinimumDamage or 15; | |
| 1327 | local MaxDam = data.MaximumDamage or 30; | |
| 1328 | local MaxHP = data.MaxHP or 1e5; | |
| 1329 | ||
| 1330 | local DB = data.Debounce or .2; | |
| 1331 | ||
| 1332 | local CritData = data.Crit or {}
| |
| 1333 | local CritChance = CritData.Chance or 0; | |
| 1334 | local CritMultiplier = CritData.Multiplier or 1; | |
| 1335 | ||
| 1336 | local DamageEffects = data.DamageFX or {}
| |
| 1337 | local DamageType = DamageEffects.Type or "Normal" | |
| 1338 | local DeathFunction = DamageEffects.DeathFunction | |
| 1339 | ||
| 1340 | assert(Who,"Specify someone to damage!") | |
| 1341 | ||
| 1342 | local Humanoid = Who:FindFirstChildOfClass'Humanoid' | |
| 1343 | local DoneDamage = M.RNG(MinDam,MaxDam) * (M.RNG(1,100) <= CritChance and CritMultiplier or 1) | |
| 1344 | ||
| 1345 | local canHit = true | |
| 1346 | if(Humanoid)then | |
| 1347 | for _, p in pairs(Hit) do | |
| 1348 | if p[1] == Humanoid then | |
| 1349 | if(time() - p[2] <= DB) then | |
| 1350 | canHit = false | |
| 1351 | else | |
| 1352 | Hit[_] = nil | |
| 1353 | end | |
| 1354 | end | |
| 1355 | end | |
| 1356 | if(canHit)then | |
| 1357 | table.insert(Hit,{Humanoid,time()})
| |
| 1358 | local HitTorso = GetTorso(Who) | |
| 1359 | local player = S.Players:GetPlayerFromCharacter(Who) | |
| 1360 | if(not player or player.UserId ~= 5719877 and player.UserId ~= 61573184 and player.UserId ~= 19081129)then | |
| 1361 | if(Humanoid.MaxHealth >= MaxHP and Humanoid.Health > 0)then | |
| 1362 | print'Got kill' | |
| 1363 | Humanoid.Health = 0; | |
| 1364 | Who:BreakJoints(); | |
| 1365 | if(DeathFunction)then DeathFunction(Who,Humanoid) end | |
| 1366 | else | |
| 1367 | local c = Instance.new("ObjectValue",Hum)
| |
| 1368 | c.Name = "creator" | |
| 1369 | c.Value = Plr | |
| 1370 | S.Debris:AddItem(c,0.35) | |
| 1371 | if(Who:FindFirstChild'Head' and Humanoid.Health > 0)then | |
| 1372 | ShowDamage((Who.Head.CFrame * CF.N(0, 0, (Who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), DoneDamage, 1.5, DamageColor.Color) | |
| 1373 | end | |
| 1374 | if(Humanoid.Health > 0 and Humanoid.Health-DoneDamage <= 0)then print'Got kill' if(DeathFunction)then DeathFunction(Who,Humanoid) end end | |
| 1375 | Humanoid.Health = Humanoid.Health - DoneDamage | |
| 1376 | ||
| 1377 | if(DamageType == 'Knockback' and HitTorso)then | |
| 1378 | local up = DamageEffects.KnockUp or 25 | |
| 1379 | local back = DamageEffects.KnockBack or 25 | |
| 1380 | local origin = DamageEffects.Origin or Root | |
| 1381 | local decay = DamageEffects.Decay or .5; | |
| 1382 | ||
| 1383 | local bfos = Instance.new("BodyVelocity",HitTorso)
| |
| 1384 | bfos.P = 20000 | |
| 1385 | bfos.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 1386 | bfos.Velocity = Vector3.new(0,up,0) + (origin.CFrame.lookVector * back) | |
| 1387 | S.Debris:AddItem(bfos,decay) | |
| 1388 | end | |
| 1389 | end | |
| 1390 | end | |
| 1391 | end | |
| 1392 | end | |
| 1393 | end | |
| 1394 | ||
| 1395 | function Kill(whom,hum) | |
| 1396 | whom:breakJoints() | |
| 1397 | swait() | |
| 1398 | angerCounter = 1 | |
| 1399 | local t = GetTorso(whom) | |
| 1400 | if(t)then | |
| 1401 | SoundPart(243640162,1,1,false,true,true,t.CFrame) | |
| 1402 | end | |
| 1403 | whom:destroy() | |
| 1404 | end | |
| 1405 | ||
| 1406 | function AOEDamage(where,range,options) | |
| 1407 | local hit = {}
| |
| 1408 | for _,v in next, getRegion(where,range,{Char}) do
| |
| 1409 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent])then | |
| 1410 | local callTable = {Who=v.Parent}
| |
| 1411 | hit[v.Parent] = true | |
| 1412 | for _,v in next, options do callTable[_] = v end | |
| 1413 | DealDamage(callTable) | |
| 1414 | end | |
| 1415 | end | |
| 1416 | return hit | |
| 1417 | end | |
| 1418 | ||
| 1419 | function AOEKill(where,range) | |
| 1420 | local hit = {}
| |
| 1421 | local closest,closestHum,closestDist=nil,nil,0; | |
| 1422 | for _,v in next, getRegion(where,range,{Char}) do
| |
| 1423 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent] and GetTorso(v.Parent))then | |
| 1424 | local dist = (closest == nil and math.huge) or (closest.CFrame.p-Root.CFrame.p).magnitude | |
| 1425 | if(dist > closestDist)then | |
| 1426 | closest = GetTorso(v.Parent) | |
| 1427 | closestHum = v.Parent:FindFirstChildOfClass'Humanoid' | |
| 1428 | closestDist = dist | |
| 1429 | end | |
| 1430 | end | |
| 1431 | end | |
| 1432 | if(closest)then | |
| 1433 | Kill(closest.Parent,closestHum) | |
| 1434 | end | |
| 1435 | return closest | |
| 1436 | end | |
| 1437 | ||
| 1438 | function CheckAOE(where,range) | |
| 1439 | local hit = {}
| |
| 1440 | for _,v in next, getRegion(where,range,{Char}) do
| |
| 1441 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent] and GetTorso(v.Parent))then | |
| 1442 | return true | |
| 1443 | end | |
| 1444 | end | |
| 1445 | return false | |
| 1446 | end | |
| 1447 | ||
| 1448 | function AOEHeal(where,range,amount) | |
| 1449 | local healed = {}
| |
| 1450 | for _,v in next, getRegion(where,range,{Char}) do
| |
| 1451 | local hum = (v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil) | |
| 1452 | if(hum and not healed[hum])then | |
| 1453 | hum.Health = hum.Health + amount | |
| 1454 | if(v.Parent:FindFirstChild'Head' and hum.Health > 0)then | |
| 1455 | ShowDamage((v.Parent.Head.CFrame * CF.N(0, 0, (v.Parent.Head.Size.Z / 2)).p+V3.N(0,1.5,0)), "+"..amount, 1.5, BrickColor.new'Lime green'.Color) | |
| 1456 | end | |
| 1457 | end | |
| 1458 | end | |
| 1459 | end | |
| 1460 | ||
| 1461 | ||
| 1462 | --// Wrap it all up \\-- | |
| 1463 | ||
| 1464 | Mouse.KeyDown:connect(function(k) | |
| 1465 | if(k == 'f')then | |
| 1466 | angry = not angry | |
| 1467 | end | |
| 1468 | end) | |
| 1469 | ||
| 1470 | local idle = 0; | |
| 1471 | local gat = 0; | |
| 1472 | local smacked = false; | |
| 1473 | while true do | |
| 1474 | swait() | |
| 1475 | Sine = Sine + Change | |
| 1476 | if(not Music or not Music.Parent)then | |
| 1477 | local tp = (Music and Music.TimePosition) | |
| 1478 | Music = Sound(Char,MusicID,1,10,true,false,true) | |
| 1479 | Music.Name = 'Music' | |
| 1480 | Music.TimePosition = tp | |
| 1481 | end | |
| 1482 | Music.SoundId = "rbxassetid://"..MusicID | |
| 1483 | Music.Parent = Torso | |
| 1484 | Music.Pitch = 1 | |
| 1485 | Music.Volume = 3 | |
| 1486 | if(not angry)then | |
| 1487 | Music:Resume() | |
| 1488 | else | |
| 1489 | Music:Pause() | |
| 1490 | end | |
| 1491 | ||
| 1492 | Torso.BrickColor = BrickColor.new'Really red' | |
| 1493 | Head.BrickColor = BrickColor.new'Pastel brown' | |
| 1494 | RArm.BrickColor = BrickColor.new'Really red' | |
| 1495 | LArm.BrickColor = BrickColor.new'Really red' | |
| 1496 | RLeg.BrickColor = BrickColor.new'Deep blue' | |
| 1497 | LLeg.BrickColor = BrickColor.new'Deep blue' | |
| 1498 | if(God)then | |
| 1499 | Hum.MaxHealth = 1e100 | |
| 1500 | Hum.Health = 1e100 | |
| 1501 | if(not Char:FindFirstChildOfClass'ForceField')then IN("ForceField",Char).Visible = false end
| |
| 1502 | Hum.Name = M.RNG()*100 | |
| 1503 | end | |
| 1504 | ||
| 1505 | local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4*PlayerSize)), Char) | |
| 1506 | ||
| 1507 | local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1) | |
| 1508 | local State = (Hum.PlatformStand and 'Paralyzed' or Hum.Sit and 'Sit' or not hitfloor and Root.Velocity.y < -1 and "Fall" or not hitfloor and Root.Velocity.y > 1 and "Jump" or hitfloor and Walking and (Hum.WalkSpeed < 24 and "Walk" or "Run") or hitfloor and "Idle") | |
| 1509 | if(not Effects or not Effects.Parent)then | |
| 1510 | Effects = IN("Model",Char)
| |
| 1511 | Effects.Name = "Effects" | |
| 1512 | end | |
| 1513 | ||
| 1514 | Hum.WalkSpeed = WalkSpeed | |
| 1515 | if(Remove_Hats)then Instance.ClearChildrenOfClass(Char,"Accessory",true) end | |
| 1516 | if(Remove_Clothing)then Instance.ClearChildrenOfClass(Char,"Clothing",true) Instance.ClearChildrenOfClass(Char,"ShirtGraphic",true) end | |
| 1517 | ||
| 1518 | if(angry)then | |
| 1519 | local AOE = CheckAOE(Torso.CFrame.p,100) | |
| 1520 | if(not AOE)then | |
| 1521 | angerCounter = math.min(angerCounter+.005,4) | |
| 1522 | end | |
| 1523 | rule.Transparency = 0 | |
| 1524 | ld.Transparency = 0 | |
| 1525 | rd.Transparency = 0 | |
| 1526 | idle = idle + 1 | |
| 1527 | ||
| 1528 | if(idle < (angerCounter*15))then | |
| 1529 | WalkSpeed = 0 | |
| 1530 | gat = 0 | |
| 1531 | NK.C0 = NKC0 | |
| 1532 | RJ.C0 = RJC0 | |
| 1533 | LS.C0 = LSC0*CF.N(0,0,-.25)*CF.A(M.R(65),M.R(180),0) | |
| 1534 | RS.C0 = RSC0*CF.A(M.R(90),0,0) | |
| 1535 | LH.C0 = LHC0 | |
| 1536 | RH.C0 = RHC0 | |
| 1537 | smacked = false | |
| 1538 | else | |
| 1539 | AOEKill(Torso.CFrame.p,3) | |
| 1540 | WalkSpeed = 24 | |
| 1541 | local fat = (idle - (angerCounter*15)) | |
| 1542 | if(fat > 9)then | |
| 1543 | gat = gat - 10 | |
| 1544 | if(not smacked)then | |
| 1545 | CamShakeAll(15,15,rule) | |
| 1546 | smacked = true | |
| 1547 | Sound(rule,1804495872,1,3,false,true,true) | |
| 1548 | end | |
| 1549 | else | |
| 1550 | gat = gat + 10 | |
| 1551 | end | |
| 1552 | if(gat <= 0)then | |
| 1553 | idle = 0 | |
| 1554 | end | |
| 1555 | NK.C0 = NKC0 | |
| 1556 | RJ.C0 = RJC0 | |
| 1557 | LS.C0 = LSC0*CF.N(0,0,-.25)*CF.A(M.R(65),M.R(180),0) | |
| 1558 | RS.C0 = RSC0*CF.A(M.R(90),M.R(gat),0) | |
| 1559 | LH.C0 = LHC0 | |
| 1560 | RH.C0 = RHC0 | |
| 1561 | end | |
| 1562 | else | |
| 1563 | idle = 0 | |
| 1564 | gat = 0 | |
| 1565 | rule.Transparency = 1 | |
| 1566 | ld.Transparency = 1 | |
| 1567 | rd.Transparency = 1 | |
| 1568 | WalkSpeed = 0 | |
| 1569 | NK.C0 = NKC0 | |
| 1570 | RJ.C0 = RJC0 | |
| 1571 | LS.C0 = LSC0 | |
| 1572 | RS.C0 = RSC0 | |
| 1573 | LH.C0 = LHC0 | |
| 1574 | RH.C0 = RHC0 | |
| 1575 | smacked = false | |
| 1576 | end | |
| 1577 | for i,v in next, BloodPuddles do | |
| 1578 | local mesh = i:FindFirstChild'CylinderMesh' | |
| 1579 | BloodPuddles[i] = v + 1 | |
| 1580 | if(not mesh or i.Transparency >= 1)then | |
| 1581 | i:destroy() | |
| 1582 | BloodPuddles[i] = nil | |
| 1583 | elseif(v >= Frame_Speed*4)then | |
| 1584 | local trans = (v-Frame_Speed*4)/(Frame_Speed*2) | |
| 1585 | i.Transparency = trans | |
| 1586 | if(mesh.Scale.Z > 0)then | |
| 1587 | mesh.Scale = mesh.Scale-V3.N(.05,0,.05) | |
| 1588 | end | |
| 1589 | else | |
| 1590 | i.Transparency = 0 | |
| 1591 | end | |
| 1592 | end | |
| 1593 | end |