Vzurxy

no die [void sb roblox]

Aug 2nd, 2020
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 40.81 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6.     print("FE Compatibility code V2 by Mokiros")
  7.     local RealPlayer = RealPlayer
  8.     script.Parent = RealPlayer.Character
  9.  
  10.     --Fake event to make stuff like Mouse.KeyDown work
  11.     local Disconnect_Function = function(this)
  12.         this[1].Functions[this[2]] = nil
  13.     end
  14.     local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15.     local FakeEvent_Metatable = {__index={
  16.         Connect = function(this,f)
  17.             local i = tostring(math.random(0,10000))
  18.             while this.Functions[i] do
  19.                 i = tostring(math.random(0,10000))
  20.             end
  21.             this.Functions[i] = f
  22.             return setmetatable({this,i},Disconnect_Metatable)
  23.         end
  24.     }}
  25.     FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26.     local function fakeEvent()
  27.         return setmetatable({Functions={}},FakeEvent_Metatable)
  28.     end
  29.  
  30.     --Creating fake input objects with fake variables
  31.     local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32.     FakeMouse.keyUp = FakeMouse.KeyUp
  33.     FakeMouse.keyDown = FakeMouse.KeyDown
  34.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37.     end}
  38.     --Merged 2 functions into one by checking amount of arguments
  39.     CAS.UnbindAction = CAS.BindAction
  40.  
  41.     --This function will trigger the events that have been :Connect()'ed
  42.     local function TriggerEvent(self,ev,...)
  43.         for _,f in pairs(self[ev].Functions) do
  44.             f(...)
  45.         end
  46.     end
  47.     FakeMouse.TriggerEvent = TriggerEvent
  48.     UIS.TriggerEvent = TriggerEvent
  49.  
  50.     --Client communication
  51.     local Event = Instance.new("RemoteEvent")
  52.     Event.Name = "UserInput_Event"
  53.     Event.OnServerEvent:Connect(function(plr,io)
  54.         if plr~=RealPlayer then return end
  55.         FakeMouse.Target = io.Target
  56.         FakeMouse.Hit = io.Hit
  57.         if not io.isMouse then
  58.             local b = io.UserInputState == Enum.UserInputState.Begin
  59.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60.                 return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61.             end
  62.             if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63.                 return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64.             end
  65.             for _,t in pairs(CAS.Actions) do
  66.                 for _,k in pairs(t.Keys) do
  67.                     if k==io.KeyCode then
  68.                         t.Function(t.Name,io.UserInputState,io)
  69.                     end
  70.                 end
  71.             end
  72.             FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73.             UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74.         end
  75.     end)
  76.     Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77.     local Mouse = owner:GetMouse()
  78.     local UIS = game:GetService("UserInputService")
  79.     local input = function(io,RobloxHandled)
  80.         if RobloxHandled then return end
  81.         --Since InputObject is a client-side instance, we create and pass table instead
  82.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83.     end
  84.     UIS.InputBegan:Connect(input)
  85.     UIS.InputEnded:Connect(input)
  86.     local h,t
  87.     --Give the server mouse data every second frame, but only if the values changed
  88.     --If player is not moving their mouse, client won't fire events
  89.     local HB = game:GetService("RunService").Heartbeat
  90.     while true do
  91.         if h~=Mouse.Hit or t~=Mouse.Target then
  92.             h,t=Mouse.Hit,Mouse.Target
  93.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  94.         end
  95.         --Wait 2 frames
  96.         for i=1,2 do
  97.             HB:Wait()
  98.         end
  99.     end]==],script)
  100.  
  101.     ----Sandboxed game object that allows the usage of client-side methods and services
  102.     --Real game object
  103.     local RealGame = game
  104.  
  105.     --Metatable for fake service
  106.     local FakeService_Metatable = {
  107.         __index = function(self,k)
  108.             local s = rawget(self,"_RealService")
  109.             if s then
  110.                 return typeof(s[k])=="function"
  111.                 and function(_,...)return s[k](s,...)end or s[k]
  112.             end
  113.         end,
  114.         __newindex = function(self,k,v)
  115.             local s = rawget(self,"_RealService")
  116.             if s then s[k]=v end
  117.         end
  118.     }
  119.     local function FakeService(t,RealService)
  120.         t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  121.         return setmetatable(t,FakeService_Metatable)
  122.     end
  123.  
  124.     --Fake game object
  125.     local FakeGame = {
  126.         GetService = function(self,s)
  127.             return rawget(self,s) or RealGame:GetService(s)
  128.         end,
  129.         Players = FakeService({
  130.             LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  131.         },"Players"),
  132.         UserInputService = FakeService(UIS,"UserInputService"),
  133.         ContextActionService = FakeService(CAS,"ContextActionService"),
  134.         RunService = FakeService({
  135.             _btrs = {},
  136.             RenderStepped = RealGame:GetService("RunService").Heartbeat,
  137.             BindToRenderStep = function(self,name,_,fun)
  138.                 self._btrs[name] = self.Heartbeat:Connect(fun)
  139.             end,
  140.             UnbindFromRenderStep = function(self,name)
  141.                 self._btrs[name]:Disconnect()
  142.             end,
  143.         },"RunService")
  144.     }
  145.     rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  146.     FakeGame.service = FakeGame.GetService
  147.     FakeService(FakeGame,game)
  148.     --Changing owner to fake player object to support owner:GetMouse()
  149.     game,owner = FakeGame,FakeGame.Players.LocalPlayer
  150. end
  151.  
  152. local plr = owner
  153. local char = plr.Character
  154. local torso = char:FindFirstChild('Torso') or char:FindFirstChild('HumanoidRootPart')
  155. local hum = nil
  156. local saved_tools = _G[plr.Name .. ' tools anti death']
  157. local shirt = ''
  158. local pants = ''
  159. local bodyColors = {
  160.     leftArmColorId = nil,
  161.     torsoColorId = nil,
  162.     rightArmColorId = nil,
  163.     headColorId = nil,
  164.     leftLegColorId = nil,
  165.     rightLegColorId = nil
  166. }
  167.  
  168. local cdata = game:GetService("Players"):GetCharacterAppearanceInfoAsync(plr.UserId)
  169. bodyColors = cdata.bodyColors
  170.  
  171. if not char then
  172.     plr:LoadCharacter()
  173.     wait()
  174. end
  175. if char then
  176.     local _shirt = char:FindFirstChild('Shirt')
  177.     if _shirt then
  178.         shirt = _shirt.ShirtTemplate
  179.     end
  180.     local _pants = char:FindFirstChild('Pants')
  181.     if _pants then
  182.         pants = _pants.PantsTemplate
  183.     end
  184. end
  185.  
  186. if saved_tools then
  187.     saved_tools:Destroy()
  188. end
  189.  
  190. _G[plr.Name .. ' tools anti death'] = Instance.new("Folder")
  191. saved_tools = _G[plr.Name .. ' tools anti death']
  192.  
  193. script.Parent = game:GetService("ServerScriptService")
  194.  
  195. function make_char()
  196. --spawn(function()
  197. char = Instance.new("Model")
  198. head = Instance.new("Part")
  199. local SpecialMesh2 = Instance.new("SpecialMesh")
  200. local Decal3 = Instance.new("Decal")
  201. torso = Instance.new("Part")
  202. local Decal5 = Instance.new("Decal")
  203. local Motor6 = Instance.new("Motor")
  204. local Motor7 = Instance.new("Motor")
  205. local Motor8 = Instance.new("Motor")
  206. local Motor9 = Instance.new("Motor")
  207. local Motor10 = Instance.new("Motor")
  208. local larm = Instance.new("Part")
  209. local rarm = Instance.new("Part")
  210. local lleg = Instance.new("Part")
  211. local rleg = Instance.new("Part")
  212. hum = Instance.new("Humanoid")
  213. local CFrameValue16 = Instance.new("CFrameValue")
  214. local BoolValue17 = Instance.new("BoolValue")
  215. local IntValue18 = Instance.new("IntValue")
  216. local BoolValue19 = Instance.new("BoolValue")
  217. local BrickColorValue20 = Instance.new("BrickColorValue")
  218. local BoolValue21 = Instance.new("BoolValue")
  219. local BoolValue22 = Instance.new("BoolValue")
  220. local BoolValue23 = Instance.new("BoolValue")
  221. local Vector3Value24 = Instance.new("Vector3Value")
  222. local BoolValue25 = Instance.new("BoolValue")
  223. local BoolValue26 = Instance.new("BoolValue")
  224. local BodyColors27 = Instance.new("BodyColors")
  225. local BoolValue28 = Instance.new("BoolValue")
  226. local IntValue30 = Instance.new("IntValue")
  227. local IntValue31 = Instance.new("IntValue")
  228. local IntValue32 = Instance.new("IntValue")
  229. char.Name = game:GetService("HttpService"):GenerateGUID(false) or '' -- character name
  230. char.Parent = workspace
  231. char.PrimaryPart = head
  232. head.Name = "Head"
  233. head.Parent = char
  234. head.CFrame = CFrame.new(-6.13871098, 4.49999905, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  235. head.Position = Vector3.new(-6.13871098, 4.49999905, -11.4352522)
  236. head.Color = Color3.new(0.643137, 0.741176, 0.278431)
  237. head.Size = Vector3.new(2, 1, 1)
  238. head.BrickColor = BrickColor.new("Br. yellowish green")
  239. head.TopSurface = Enum.SurfaceType.Smooth
  240. head.brickColor = BrickColor.new("Br. yellowish green")
  241. head.FormFactor = Enum.FormFactor.Symmetric
  242. head.formFactor = Enum.FormFactor.Symmetric
  243. SpecialMesh2.Parent = head
  244. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  245. Decal3.Name = "face"
  246. Decal3.Parent = head
  247. Decal3.Texture = "http://www.roblox.com/asset/?id=8560915"
  248. torso.Name = "Torso"
  249. torso.Parent = char
  250. torso.CFrame = CFrame.new(-6.13871098, 2.99999905, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  251. torso.Position = Vector3.new(-6.13871098, 2.99999905, -11.4352522)
  252. torso.Color = Color3.new(1, 1, 0)
  253. torso.Size = Vector3.new(2, 2, 1)
  254. torso.BrickColor = BrickColor.new("New Yeller")
  255. torso.LeftParamA = 0
  256. torso.LeftParamB = 0
  257. torso.LeftSurface = Enum.SurfaceType.Weld
  258. torso.RightParamA = 0
  259. torso.RightParamB = 0
  260. torso.RightSurface = Enum.SurfaceType.Weld
  261. torso.brickColor = BrickColor.new("New Yeller")
  262. torso.FormFactor = Enum.FormFactor.Symmetric
  263. torso.formFactor = Enum.FormFactor.Symmetric
  264. Decal5.Name = "roblox"
  265. Decal5.Parent = torso
  266. Motor6.Name = "Right Shoulder"
  267. Motor6.Parent = torso
  268. Motor6.MaxVelocity = 0.15000000596046
  269. Motor6.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  270. Motor6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  271. Motor6.Part0 = torso
  272. Motor6.Part1 = rarm
  273. Motor6.Part1 = rarm
  274. Motor7.Name = "Left Shoulder"
  275. Motor7.Parent = torso
  276. Motor7.MaxVelocity = 0.15000000596046
  277. Motor7.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  278. Motor7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  279. Motor7.Part0 = torso
  280. Motor7.Part1 = larm
  281. Motor7.Part1 = larm
  282. Motor8.Name = "Right Hip"
  283. Motor8.Parent = torso
  284. Motor8.MaxVelocity = 0.10000000149012
  285. Motor8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  286. Motor8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  287. Motor8.Part0 = torso
  288. Motor8.Part1 = rleg
  289. Motor8.Part1 = rleg
  290. Motor9.Name = "Left Hip"
  291. Motor9.Parent = torso
  292. Motor9.MaxVelocity = 0.10000000149012
  293. Motor9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  294. Motor9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  295. Motor9.Part0 = torso
  296. Motor9.Part1 = lleg
  297. Motor9.Part1 = lleg
  298. Motor10.Name = "Neck"
  299. Motor10.Parent = torso
  300. Motor10.MaxVelocity = 0.10000000149012
  301. Motor10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  302. Motor10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  303. Motor10.Part0 = torso
  304. Motor10.Part1 = head
  305. Motor10.Part1 = head
  306. larm.Name = "Left Arm"
  307. larm.Parent = char
  308. larm.CFrame = CFrame.new(-7.63871098, 2.99999905, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  309. larm.Position = Vector3.new(-7.63871098, 2.99999905, -11.4352522)
  310. larm.Color = Color3.new(0.643137, 0.741176, 0.278431)
  311. larm.Size = Vector3.new(1, 2, 1)
  312. larm.BrickColor = BrickColor.new("Br. yellowish green")
  313. larm.CanCollide = false
  314. larm.brickColor = BrickColor.new("Br. yellowish green")
  315. larm.FormFactor = Enum.FormFactor.Symmetric
  316. larm.formFactor = Enum.FormFactor.Symmetric
  317. rarm.Name = "Right Arm"
  318. rarm.Parent = char
  319. rarm.CFrame = CFrame.new(-4.63871098, 2.99999905, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  320. rarm.Position = Vector3.new(-4.63871098, 2.99999905, -11.4352522)
  321. rarm.Color = Color3.new(0.643137, 0.741176, 0.278431)
  322. rarm.Size = Vector3.new(1, 2, 1)
  323. rarm.BrickColor = BrickColor.new("Br. yellowish green")
  324. rarm.CanCollide = false
  325. rarm.brickColor = BrickColor.new("Br. yellowish green")
  326. rarm.FormFactor = Enum.FormFactor.Symmetric
  327. rarm.formFactor = Enum.FormFactor.Symmetric
  328. lleg.Name = "Left Leg"
  329. lleg.Parent = char
  330. lleg.CFrame = CFrame.new(-6.63871098, 0.999999046, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  331. lleg.Position = Vector3.new(-6.63871098, 0.999999046, -11.4352522)
  332. lleg.Color = Color3.new(1, 1, 0)
  333. lleg.Size = Vector3.new(1, 2, 1)
  334. lleg.BottomSurface = Enum.SurfaceType.Smooth
  335. lleg.BrickColor = BrickColor.new("New Yeller")
  336. lleg.CanCollide = false
  337. lleg.TopSurface = Enum.SurfaceType.Inlet
  338. lleg.brickColor = BrickColor.new("New Yeller")
  339. lleg.FormFactor = Enum.FormFactor.Symmetric
  340. lleg.formFactor = Enum.FormFactor.Symmetric
  341. rleg.Name = "Right Leg"
  342. rleg.Parent = char
  343. rleg.CFrame = CFrame.new(-5.63871098, 0.999999046, -11.4352522, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  344. rleg.Position = Vector3.new(-5.63871098, 0.999999046, -11.4352522)
  345. rleg.Color = Color3.new(1, 1, 0)
  346. rleg.Size = Vector3.new(1, 2, 1)
  347. rleg.BottomSurface = Enum.SurfaceType.Smooth
  348. rleg.BrickColor = BrickColor.new("New Yeller")
  349. rleg.CanCollide = false
  350. rleg.TopSurface = Enum.SurfaceType.Inlet
  351. rleg.brickColor = BrickColor.new("New Yeller")
  352. rleg.FormFactor = Enum.FormFactor.Symmetric
  353. rleg.formFactor = Enum.FormFactor.Symmetric
  354. hum.Parent = char
  355. hum.LeftLeg = lleg
  356. hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  357. hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  358. hum.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  359. hum.RightLeg = rleg
  360. hum.Torso = torso
  361. CFrameValue16.Name = "IsAPlayer"
  362. CFrameValue16.Parent = char
  363. BoolValue17.Name = "Respawn"
  364. BoolValue17.Parent = char
  365. BoolValue17.Value = true
  366. IntValue18.Name = "Force_Weapon"
  367. IntValue18.Parent = char
  368. BoolValue19.Name = "IsOnTeam"
  369. BoolValue19.Parent = char
  370. BrickColorValue20.Name = "Team"
  371. BrickColorValue20.Parent = BoolValue19
  372. BrickColorValue20.Value = BrickColor.new("Really black")
  373. BoolValue21.Name = "ShowTag"
  374. BoolValue21.Parent = BoolValue19
  375. BoolValue22.Name = "IgnoreCombatFF"
  376. BoolValue22.Parent = char
  377. BoolValue22.Value = true
  378. BoolValue23.Name = "DropWeapon"
  379. BoolValue23.Parent = char
  380. BoolValue23.Value = true
  381. Vector3Value24.Name = "PathTo"
  382. Vector3Value24.Parent = char
  383. BoolValue25.Name = "Wander"
  384. BoolValue25.Parent = char
  385. BoolValue25.Value = true
  386. BoolValue26.Name = "PrintMap"
  387. BoolValue26.Parent = char
  388. BodyColors27.Parent = char
  389. BodyColors27.HeadColor = BrickColor.new(bodyColors.headColorId) or BrickColor.new("Br. yellowish green")
  390. BodyColors27.LeftArmColor = BrickColor.new(bodyColors.leftArmColorId) or BrickColor.new("Br. yellowish green")
  391. BodyColors27.LeftLegColor = BrickColor.new(bodyColors.leftLegColorId) or BrickColor.new("New Yeller")
  392. BodyColors27.RightArmColor = BrickColor.new(bodyColors.rightArmColorId) or BrickColor.new("Br. yellowish green")
  393. BodyColors27.RightLegColor = BrickColor.new(bodyColors.rightLegColorId) or BrickColor.new("New Yeller")
  394. BodyColors27.TorsoColor = BrickColor.new(bodyColors.torsoColorId) or BrickColor.new("New Yeller")
  395. BoolValue28.Name = "ForceColors"
  396. BoolValue28.Parent = BodyColors27
  397.  
  398. local Hat0 = Instance.new("Hat")
  399. local Part1 = Instance.new("Part")
  400. local SpecialMesh2 = Instance.new("SpecialMesh")
  401. local Hat3 = Instance.new("Hat")
  402. local Part4 = Instance.new("Part")
  403. local SpecialMesh5 = Instance.new("SpecialMesh")
  404. Hat0.Name = "ClockworksShades"
  405. Hat0.Parent = char
  406. Hat0.AttachmentPoint = CFrame.new(0, 0.25999999, 0.150000006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  407. Hat0.AttachmentPos = Vector3.new(0, 0.25999999, 0.150000006)
  408. Part1.Name = "Handle"
  409. Part1.Parent = Hat0
  410. Part1.CFrame = CFrame.new(6.14723778, 4.73999882, -13.5720253, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  411. Part1.Position = Vector3.new(6.14723778, 4.73999882, -13.5720253)
  412. Part1.Size = Vector3.new(1, 1.60000002, 1)
  413. Part1.BottomSurface = Enum.SurfaceType.Smooth
  414. Part1.CanCollide = false
  415. Part1.Locked = true
  416. Part1.TopSurface = Enum.SurfaceType.Smooth
  417. Part1.FormFactor = Enum.FormFactor.Plate
  418. Part1.formFactor = Enum.FormFactor.Plate
  419. SpecialMesh2.Parent = Part1
  420. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=1577360"
  421. SpecialMesh2.Scale = Vector3.new(1, 1.29999995, 1)
  422. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=1577349"
  423. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  424. Hat3.Name = "DominoCrown"
  425. Hat3.Parent = char
  426. Hat3.AttachmentPoint = CFrame.new(0, -0.449999988, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  427. Hat3.AttachmentPos = Vector3.new(0, -0.449999988, 0)
  428. Part4.Name = "Handle"
  429. Part4.Parent = Hat3
  430. Part4.CFrame = CFrame.new(6.14723778, 5.44999886, -13.4220257, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  431. Part4.Position = Vector3.new(6.14723778, 5.44999886, -13.4220257)
  432. Part4.Size = Vector3.new(1, 0.800000012, 1)
  433. Part4.BottomSurface = Enum.SurfaceType.Smooth
  434. Part4.CanCollide = false
  435. Part4.Locked = true
  436. Part4.TopSurface = Enum.SurfaceType.Smooth
  437. Part4.FormFactor = Enum.FormFactor.Plate
  438. Part4.formFactor = Enum.FormFactor.Plate
  439. SpecialMesh5.Parent = Part4
  440. SpecialMesh5.MeshId = "http://www.roblox.com/asset/?id=1031410"
  441. SpecialMesh5.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
  442. SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=1031417"
  443. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  444.  
  445. if shirt ~= '' then
  446.     local _shirt = Instance.new("Shirt")
  447.     _shirt.ShirtTemplate = shirt
  448.     _shirt.Parent = char
  449. end
  450. if pants ~= '' then
  451.     local _pants = Instance.new("Pants")
  452.     _pants.PantsTemplate =  pants
  453.     _pants.Parent = char
  454. end
  455.  
  456. plr.Character = char
  457. set_owner()
  458.  
  459. --Delay(0, function() --Vanilla Sound
  460.     function waitForChild(parent, childName)
  461.         local child = parent:findFirstChild(childName)
  462.         if child then return child end
  463.         spawn(function()
  464.             while true do
  465.                 child = parent.ChildAdded:wait()
  466.                 if child.Name==childName then return child end
  467.             end
  468.         end)
  469.     end
  470.     function newSound(id)
  471.         local sound = Instance.new("Sound")
  472.         sound.SoundId = id
  473.         sound.archivable = false
  474.         sound.Parent = head
  475.         return sound
  476.     end
  477.     local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  478.     local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  479.     local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  480.     local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  481.     local sJumping = newSound("rbxasset://sounds/button.wav")
  482.     local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  483.     sRunning.Looped = true
  484.     local Figure = char
  485.     local Head = waitForChild(Figure, "Head")
  486.     local Humanoid = waitForChild(Figure, "Humanoid")
  487.     function onDied()
  488.         sDied:Play()
  489.     end
  490.     function onState(state, sound)
  491.         if state then
  492.             sound:Play()
  493.         else
  494.             sound:Pause()
  495.         end
  496.     end
  497.     function onRunning(speed)
  498.         if speed>0 then
  499.             sRunning:Play()
  500.         else
  501.             sRunning:Pause()
  502.         end
  503.     end
  504.     Humanoid.Died:connect(onDied)
  505.     Humanoid.Running:connect(onRunning)
  506.     Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  507.     Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  508.     Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  509.     Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  510. --end)
  511. --Delay(0, function() --Vanilla Health
  512.     function waitForChild(parent, childName)
  513.         local child = parent:findFirstChild(childName)
  514.         if child then return child end
  515.         spawn(function()
  516.             while true do
  517.                 child = parent.ChildAdded:wait()
  518.                 if child.Name==childName then return child end
  519.             end
  520.         end)
  521.     end
  522.     local Figure = char
  523.     local Humanoid = waitForChild(Figure, "Humanoid")
  524.     local regening = false
  525.     function regenHealth()
  526.         if regening then return end
  527.         regening = true
  528.         spawn(function()
  529.             while Humanoid.Health < Humanoid.MaxHealth do
  530.                 local s = wait(1)
  531.                 local health = Humanoid.Health
  532.                 if health > 0 and health < Humanoid.MaxHealth then
  533.                     local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  534.                     health = health + newHealthDelta
  535.                     Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  536.                 end
  537.             end
  538.         end)
  539.         if Humanoid.Health > Humanoid.MaxHealth then
  540.             Humanoid.Health = Humanoid.MaxHealth
  541.         end
  542.         regening = false
  543.     end
  544.     Humanoid.HealthChanged:connect(regenHealth)
  545. --end)
  546. --Delay(0, function() --Vanilla Animate, Multiple Additions
  547.     function waitForChild(parent, childName)
  548.         local child = parent:findFirstChild(childName)
  549.         if child then return child end
  550.         spawn(function()
  551.             while true do
  552.                 child = parent.ChildAdded:wait()
  553.                 if child.Name==childName then return child end
  554.             end
  555.         end)
  556.     end
  557.     local Figure = char
  558.     local Clone = Figure:Clone()
  559.     local Torso = waitForChild(Figure, "Torso")
  560.     local Joints = Torso:GetChildren()
  561.     for All = 1, #Joints do
  562.         if Joints.className == "Motor" or Joints.className == "Motor6D" then
  563.             Joints[All]:Remove()
  564.         end
  565.     end
  566.     local RightShoulder = Instance.new("Motor")
  567.     local LeftShoulder = Instance.new("Motor")
  568.     local RightHip = Instance.new("Motor")
  569.     local LeftHip = Instance.new("Motor")
  570.     local Neck = Instance.new("Motor")
  571.     local Humanoid = waitForChild(Figure, "Humanoid")
  572.     ZStat = 1
  573.     ZStat2 = 0
  574.     local pose = "Standing"
  575.     RightShoulder.Part0 = Torso
  576.     RightShoulder.Part1 = Figure["Right Arm"]
  577.     RightShoulder.MaxVelocity = 0.15
  578.     RightShoulder.Name = "Right Shoulder"
  579.     RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  580.     RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  581.     RightShoulder.Parent = Torso
  582.     LeftShoulder.Part0 = Torso
  583.     LeftShoulder.Part1 = Figure["Left Arm"]
  584.     LeftShoulder.MaxVelocity = 0.15
  585.     LeftShoulder.Name = "Left Shoulder"
  586.     LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  587.     LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  588.     LeftShoulder.Parent = Torso
  589.     RightHip.Part0 = Torso
  590.     RightHip.Part1 = Figure["Right Leg"]
  591.     RightHip.MaxVelocity = 0.1
  592.     RightHip.Name = "Right Hip"
  593.     RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  594.     RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  595.     RightHip.Parent = Torso
  596.     LeftHip.Part0 = Torso
  597.     LeftHip.Part1 = Figure["Left Leg"]
  598.     LeftHip.MaxVelocity = 0.1
  599.     LeftHip.Name = "Left Hip"
  600.     LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  601.     LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  602.     LeftHip.Parent = Torso
  603.     Neck.Part0 = Torso
  604.     Neck.Part1 = Figure["Head"]
  605.     Neck.MaxVelocity = 0.1
  606.     Neck.Name = "Neck"
  607.     Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  608.     Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  609.     Neck.Parent = Torso
  610.     local toolAnim = "None"
  611.     local toolAnimTime = 0
  612.     SpawnModel = Instance.new("Model")
  613.     function onRunning(speed)
  614.         if speed>0 then
  615.             pose = "Running"
  616.         else
  617.             pose = "Standing"
  618.         end
  619.     end
  620.     function CheckTag(Tag)
  621.         if char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  622.             if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
  623.                 if (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == Tag.Value.TeamColor) or char.IsOnTeam.Value == false then
  624.                     local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
  625.                     Tag2.Name = "IsLocalEnemy"
  626.                     --print(Tag.Value.Character.Name .." Has Become An Outlaw")
  627.                 end
  628.             end
  629.             if Tag.Value.Character:FindFirstChild("Loc" ..char.Name) ~= nil then
  630.                 Tag.Value.Character:FindFirstChild("Loc" ..char.Name):Remove()
  631.             end
  632.             local Found = Instance.new("CFrameValue", Tag.Value.Character)
  633.             Found.Name = "Loc" ..char.Name
  634.             game:GetService("Debris"):AddItem(Found, 3)
  635.         elseif char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then
  636.             if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
  637.                 if (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or char.IsOnTeam.Value == false then
  638.                     local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  639.                     Tag2.Name = "IsLocalEnemy"
  640.                     --print(Tag.Value .." Has Become An Outlaw")
  641.                 end
  642.             end
  643.             if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..char.Name) ~= nil then
  644.                 game.Players[Tag.Value].Character:FindFirstChild("Loc" ..char.Name):Remove()
  645.             end
  646.             local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  647.             Found.Name = "Loc" ..char.Name
  648.             game:GetService("Debris"):AddItem(Found, 3)
  649.         elseif char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and workspace:FindFirstChild(Tag.Value) ~= nil then
  650.             if workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
  651.                 if (char.IsOnTeam.Value == true and IsInCombat == false and workspace[Tag.Value].IsOnTeam.Value == true and char.IsOnTeam.Team.Value == workspace[Tag.Value].IsOnTeam.Team.Value) or char.IsOnTeam.Value == false or workspace[Tag.Value].IsOnTeam.Value == false then
  652.                     local Tag2 = Instance.new("CFrameValue", workspace[Tag.Value])
  653.                     Tag2.Name = "IsLocalEnemy"
  654.                     --print(Tag.Value .." Has Become An Outlaw")
  655.                 end
  656.             end
  657.             if workspace[Tag.Value]:FindFirstChild("Loc" ..char.Name) ~= nil then
  658.                 workspace[Tag.Value]:FindFirstChild("Loc" ..char.Name):Remove()
  659.             end
  660.             local Found = Instance.new("CFrameValue", workspace[Tag.Value])
  661.             Found.Name = "Loc" ..char.Name
  662.             game:GetService("Debris"):AddItem(Found, 3)
  663.         elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  664.             local Found = Instance.new("CFrameValue", Tag.Value.Character)
  665.             Found.Name = "Loc" ..char.Name
  666.             game:GetService("Debris"):AddItem(Found, 3)
  667.         elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and workspace:FindFirstChild(Tag.Value) ~= nil then
  668.             local Found = Instance.new("CFrameValue", workspace[Tag.Value])
  669.             Found.Name = "Loc" ..char.Name
  670.             game:GetService("Debris"):AddItem(Found, 3)
  671.         end
  672.     end
  673.     function CheckSpawns(Object)
  674.         local Parts = Object:GetChildren()
  675.         for Check = 1, #Parts do
  676.             if Parts[Check].className == "SpawnLocation" then
  677.                 local I = Instance.new("Vector3Value", SpawnModel)
  678.                 I.Value = Parts[Check].Position
  679.             end
  680.             CheckSpawns(Parts[Check])
  681.         end
  682.     end
  683.     function onDied()
  684.         pose = "Dead"
  685.         --[[
  686.         wait(5)
  687.             if char.Respawn.Value == true then
  688.                 CheckSpawns(Workspace)
  689.                 local Spawn = SpawnModel:GetChildren()
  690.                 Clone.Parent = workspace
  691.                 if #Spawn > 0 then
  692.                     Spawn = Spawn[math.random(1, #Spawn)].Value
  693.                     Clone:MoveTo(Spawn)
  694.                 else
  695.                     Clone:MoveTo(Vector3.new(0, 50, 0))
  696.                 end
  697.             end
  698.             Figure:Remove()
  699.             return
  700.         ]]
  701.     end
  702.     function onJumping()
  703.         pose = "Jumping"
  704.     end
  705.     function onClimbing()
  706.         pose = "Climbing"
  707.     end
  708.     function onGettingUp()
  709.         pose = "GettingUp"
  710.     end
  711.     function onFreeFall()
  712.         pose = "FreeFall"
  713.     end
  714.     function onFallingDown()
  715.         pose = "FallingDown"
  716.     end
  717.     function onSeated()
  718.         pose = "Seated"
  719.     end
  720.     function onPlatformStanding()
  721.         pose = "PlatformStanding"
  722.     end
  723.     function moveJump()
  724.         RightShoulder.MaxVelocity = 0.5
  725.         LeftShoulder.MaxVelocity = 0.5
  726.         RightShoulder.DesiredAngle = (3.14/ZStat)
  727.         LeftShoulder.DesiredAngle = (-3.14/ZStat)
  728.         RightHip.DesiredAngle = (0)
  729.         LeftHip.DesiredAngle = (0)
  730.     end
  731.     function moveFreeFall()
  732.         RightShoulder.MaxVelocity = 0.5
  733.         LeftShoulder.MaxVelocity = 0.5
  734.         RightShoulder.DesiredAngle = (3.14/ZStat)
  735.         LeftShoulder.DesiredAngle = (-3.14/ZStat)
  736.         RightHip.DesiredAngle = (0)
  737.         LeftHip.DesiredAngle = (0)
  738.     end
  739.     function moveSit()
  740.         RightShoulder.MaxVelocity = 0.15
  741.         LeftShoulder.MaxVelocity = 0.15
  742.         RightShoulder.DesiredAngle = (3.14 /2)
  743.         LeftShoulder.DesiredAngle = (-3.14 /2)
  744.         RightHip.DesiredAngle = (3.14 /2)
  745.         LeftHip.DesiredAngle = (-3.14 /2)
  746.     end
  747.     function getTool()  
  748.         for _, kid in ipairs(Figure:GetChildren()) do
  749.             if kid.className == "Tool" then return kid end
  750.         end
  751.         return nil
  752.     end
  753.     function getToolAnim(tool)
  754.         for _, c in ipairs(tool:GetChildren()) do
  755.             if c.Name == "toolanim" and c.className == "StringValue" then
  756.                 return c
  757.             end
  758.         end
  759.         return nil
  760.     end
  761.     function animateTool()
  762.         if (toolAnim == "None") then
  763.             RightShoulder.DesiredAngle = (1.57)
  764.             return
  765.         end
  766.         if (toolAnim == "Slash") then
  767.             RightShoulder.MaxVelocity = 0.5
  768.             RightShoulder.DesiredAngle = (0)
  769.             return
  770.         end
  771.         if (toolAnim == "Lunge") then
  772.             RightShoulder.MaxVelocity = 0.5
  773.             LeftShoulder.MaxVelocity = 0.5
  774.             RightHip.MaxVelocity = 0.5
  775.             LeftHip.MaxVelocity = 0.5
  776.             RightShoulder.DesiredAngle = (1.57)
  777.             LeftShoulder.DesiredAngle = (1.0)
  778.             RightHip.DesiredAngle = (1.57)
  779.             LeftHip.DesiredAngle = (1.0)
  780.             return
  781.         end
  782.     end
  783.     function move(time)
  784.         local amplitude
  785.         local frequency
  786.         if (pose == "Jumping") then
  787.             moveJump()
  788.             return
  789.         end
  790.         if (pose == "FreeFall") then
  791.             moveFreeFall()
  792.             return
  793.         end  
  794.         if (pose == "Seated") then
  795.             moveSit()
  796.             return
  797.         end
  798.         local climbFudge = 0
  799.         if (pose == "Running") then
  800.             RightShoulder.MaxVelocity = 0.15
  801.             LeftShoulder.MaxVelocity = 0.15
  802.             amplitude = 1
  803.             frequency = 9
  804.         elseif (pose == "Climbing") then
  805.             RightShoulder.MaxVelocity = 0.5
  806.             LeftShoulder.MaxVelocity = 0.5
  807.             amplitude = 1
  808.             frequency = 9
  809.             climbFudge = 3.14
  810.         else
  811.             amplitude = 0.1
  812.             frequency = 1
  813.         end
  814.         desiredAngle = amplitude * math.sin(time*frequency)
  815.         RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
  816.         LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
  817.         RightHip.DesiredAngle = (-desiredAngle)
  818.         LeftHip.DesiredAngle = (-desiredAngle)
  819.         local tool = getTool()
  820.         if tool then
  821.             animStringValueObject = getToolAnim(tool)
  822.             if animStringValueObject then
  823.                 toolAnim = animStringValueObject.Value
  824.                 animStringValueObject.Parent = nil
  825.                 toolAnimTime = time + .3
  826.             end
  827.             if time > toolAnimTime then
  828.                 toolAnimTime = 0
  829.                 toolAnim = "None"
  830.             end
  831.             animateTool()
  832.         else
  833.             toolAnim = "None"
  834.             toolAnimTime = 0
  835.         end
  836.     end
  837.     Humanoid.Died:connect(onDied)
  838.     Humanoid.Running:connect(onRunning)
  839.     Humanoid.Jumping:connect(onJumping)
  840.     Humanoid.Climbing:connect(onClimbing)
  841.     Humanoid.GettingUp:connect(onGettingUp)
  842.     Humanoid.FreeFalling:connect(onFreeFall)
  843.     Humanoid.FallingDown:connect(onFallingDown)
  844.     Humanoid.Seated:connect(onSeated)
  845.     Humanoid.PlatformStanding:connect(onPlatformStanding)
  846.     Humanoid.ChildAdded:connect(CheckTag)
  847.     OriginalTime = 0.1
  848.     Time = OriginalTime
  849.     spawn(function()
  850.         while Figure.Parent~=nil do
  851.             Time = Time + 0.1
  852.             wait(OriginalTime)
  853.             move(Time)
  854.         end
  855.     end)
  856. --end)
  857. --[[
  858. spawn(function()
  859. while char and char.Parent and torso and torso.Parent do
  860.     wait(math.random(40, 70 + math.random(30, 120)) / 10)
  861.     local Weapon = nil
  862.     local ToolCheck = char:GetChildren()
  863.     for Check = 1, #ToolCheck do
  864.         if ToolCheck[Check].ClassName == "Tool" then
  865.             Weapon = ToolCheck[Check]
  866.         end
  867.     end
  868.     if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  869.         if Weapon.Type.Value == "HealDrink" then
  870.             Weapon.Active.Value = true
  871.         end
  872.     end
  873. end
  874. end)
  875. ]]
  876. --end)
  877. end
  878.  
  879. function set_owner()
  880.     if char then else return end
  881.     for i,v in pairs(char:GetChildren()) do
  882.         if v:IsA("BasePart") and v:CanSetNetworkOwnership() then
  883.             v:SetNetworkOwner(plr)
  884.         end
  885.     end
  886. end
  887.  
  888. local oldpos = CFrame.new()
  889. local rebirthing = false
  890. local updating_inv = false
  891. local connection = nil
  892. local barrier = nil
  893.  
  894. if torso then
  895.     oldpos = torso.CFrame
  896. end
  897.  
  898. local remote = Instance.new("RemoteEvent")
  899. remote.Parent = plr['PlayerGui']
  900.  
  901. remote.OnServerEvent:Connect(function(lplr,pos)
  902.     if not rebirthing and (plr == lplr) then
  903.         --oldpos = pos
  904.     end
  905. end)
  906.  
  907. local ls = [[
  908.     local plr = game:GetService("Players").LocalPlayer
  909.     local char = nil
  910.     local torso = nil
  911.     local hum = nil
  912.     local remote = script.Parent
  913.     local camera = workspace.CurrentCamera
  914.     camera.CameraType = Enum.CameraType.Custom
  915.     game:GetService("RunService").Heartbeat:Connect(function()
  916.         spawn(function()
  917.             if not char or not char.Parent or not torso or not torso.Parent or not hum or not hum.Parent then
  918.                 repeat wait() until plr.Character
  919.                 char = plr.Character
  920.                 torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  921.                 hum = char:FindFirstChildOfClass("Humanoid")
  922.             end
  923.             if torso and torso.Parent then
  924.                 --remote:FireServer(torso.CFrame)
  925.             end
  926.             if char and char.Parent and hum and hum.Parent then
  927.                 camera.CameraSubject = hum
  928.             end
  929.         end)
  930.     end)
  931. ]]
  932.  
  933. NLS(ls,remote)
  934.  
  935. local pdata = {
  936.     ws = 16,
  937.     hh = 0,
  938.     msa = 89,
  939.     jp = 50,
  940.     sit = false,
  941.     platformstand = false,
  942.     autorotate = true,
  943.     usejumppower = true,
  944.     autojump = true,
  945.     --breakjoints = false
  946.     --jump = false,
  947. }
  948.  
  949. function update_pdata(...)
  950.     local data = ...
  951.     pdata = data
  952. end
  953.  
  954. function update_inv()
  955.     if not updating_inv then else return end
  956.     updating_inv = true
  957.     for i,v in pairs(saved_tools:GetChildren()) do v:Destroy(); end;
  958.     for i,v in pairs(plr['Backpack']:GetChildren()) do
  959.         v:Clone().Parent = saved_tools
  960.     end
  961.     for i,v in pairs(char:GetChildren()) do
  962.         v:Clone().Parent = saved_tools
  963.     end
  964.     updating_inv = false
  965. end
  966.  
  967. function load_inv()
  968.     spawn(function()
  969.         for i,v in pairs(saved_tools:GetChildren()) do
  970.             v:Clone().Parent = plr['Backpack']
  971.         end
  972.     end)
  973. end
  974.  
  975. function smart_add(p)
  976.     spawn(function()
  977.         for i,v in pairs(p:GetChildren()) do
  978.             v.ChildAdded:Connect(function(obj)
  979.                 if obj:IsA('Script') or obj:IsA('LocalScript') or obj:IsA('BodyForce') or obj:IsA('BodyGyro') or obj:IsA('BodyAngularVelocity') or obj:IsA('BodyPosition') or obj:IsA('BodyMover') or obj:IsA('BodyVelocity') or obj:IsA('BodyThrust') then
  980.                     obj:Destroy()
  981.                 end
  982.             end)
  983.         end
  984.     end)
  985. end
  986.  
  987. function load_pdata(char,torso,hum)
  988.     pcall(function()
  989.         hum.WalkSpeed = pdata.ws or 16;
  990.         hum.HipHeight = pdata.hh or 0;
  991.         hum.MaxSlopeAngle = pdata.msa or 89;
  992.         hum.JumpPower = pdata.jp or 50;
  993.         hum.Sit = pdata.sit or false;
  994.         hum.PlatformStand = pdata.platformstand or false;
  995.         hum.AutoRotate = pdata.autorotate or true;
  996.         hum.UseJumpPower = pdata.usejumppower or true;
  997.         hum.AutoJumpEnabled = pdata.autojump or true;
  998.         hum.BreakJointsOnDeath = false;
  999.         hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false);
  1000.         hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false);
  1001.         hum.MaxHealth = 1/0
  1002.         hum.Health = 1/0
  1003.         torso.Velocity = Vector3.new()
  1004.         torso.CFrame = oldpos
  1005.         local ff = char:FindFirstChildOfClass("ForceField")
  1006.         if ff then
  1007.             ff:Destroy()
  1008.         end
  1009.         local ff = Instance.new("ForceField")
  1010.         ff.Visible = false
  1011.         ff.Parent = char
  1012.         smart_add(char)
  1013.         make_barrier(torso,char,workspace)
  1014.     end)
  1015. end
  1016.  
  1017. function make_barrier(root,char,p)
  1018.     spawn(function()
  1019.         barrier = Instance.new("Part")
  1020.         barrier.Name = game:GetService("HttpService"):GenerateGUID(false) or ''
  1021.         barrier.Transparency = 1
  1022.         barrier.Size = Vector3.new(10,10,10)
  1023.         barrier.CanCollide = false
  1024.         barrier.Massless = true
  1025.         barrier.Locked = true
  1026.         barrier.Archivable = false
  1027.         barrier.Parent = p
  1028.         local weld = Instance.new("Weld")
  1029.         weld.Part0 = root
  1030.         weld.Part1 = barrier
  1031.         weld.Parent = barrier
  1032.         barrier.Touched:Connect(function(obj)
  1033.             local n = string.lower(obj.Name)
  1034.             --local found = false
  1035.             if (n and (n == 'base' or n == 'baseplate')) or (char and obj:IsDescendantOf(char)) or not obj:FindFirstChildOfClass('TouchInterest') then
  1036.                 --found = true
  1037.             else
  1038.                 obj = nil;
  1039.             end
  1040.         end)
  1041.         connection = p.ChildRemoved:Connect(function(obj)
  1042.             if obj == barrier or obj == weld then
  1043.                 if obj then obj:Destroy(); end; if connection then connection:Disconnect(); end;
  1044.                 make_barrier(root,char,p)
  1045.             end
  1046.         end)
  1047.         barrier.ChildRemoved:Connect(function(obj)
  1048.             if obj == weld then
  1049.                 if connection then connection:Disconnect(); end; if barrier then barrier:Destroy(); end;
  1050.                 make_barrier(root,char,p)
  1051.             end
  1052.         end)
  1053.     end)
  1054. end
  1055.  
  1056. function rebirth()
  1057.     rebirthing = true
  1058.     make_char()
  1059.     --load_inv()
  1060.     load_pdata(char,torso,hum)
  1061.     rebirthing = false
  1062.     setup()
  1063. end
  1064.  
  1065. function setup()
  1066.     local died = false
  1067.        
  1068.     local function alive()
  1069.         local alive = false
  1070.         if char and char.Parent and (char.Parent == workspace) and torso and torso.Parent and hum and hum.Parent and hum.Health > 0 then
  1071.             alive = true
  1072.         end
  1073.         return alive
  1074.     end
  1075.    
  1076.     --spawn(function()
  1077.         while not died do
  1078.             if not alive() then
  1079.                 died = true
  1080.             end
  1081.             if not alive() and not rebirthing then
  1082.                 rebirth()
  1083.             end
  1084.             if alive() and not rebirthing and not died then
  1085.                 local tdata = {
  1086.                     --ws = hum.WalkSpeed,
  1087.                     --hh = hum.HipHeight,
  1088.                     --msa = hum.MaxSlopeAngle,
  1089.                     --jp = hum.JumpPower,
  1090.                     sit = hum.Sit,
  1091.                     --platformstand = hum.PlatformStand,
  1092.                     --autorotate = hum.AutoRotate,
  1093.                     --usejumppower = hum.UseJumpPower,
  1094.                     --autojump = hum.AutoJumpEnabled,
  1095.                 }
  1096.                 --update_inv()
  1097.                 update_pdata(tdata)
  1098.                 if char then
  1099.                     --plr.Character = char
  1100.                 end
  1101.                 hum.MaxHealth = 1/0; hum.Health = 1/0;
  1102.                 if 100 >= (torso.Position.Y-workspace.FallenPartsDestroyHeight) then
  1103.                     barrier.Velocity = Vector3.new()
  1104.                     barrier.Position = Vector3.new(math.random(1,100),5,math.random(1,100))
  1105.                 end
  1106.                 oldpos = torso.CFrame
  1107.             end
  1108.             game:GetService("RunService").Heartbeat:Wait(1/30)
  1109.         end
  1110.     --end)
  1111. end
  1112.  
  1113. rebirth()
Add Comment
Please, Sign In to add comment