VoidScripteay72

Fe Dragon Hat

Aug 12th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. --[[
  2. Made by Rouxhaver
  3. Netlibary made by 4eyes
  4. Currently works with Celery executor and Fluxus
  5.  
  6. Note: Hat network ownership has been weird recently so expect a few resets
  7. ]]
  8.  
  9. local Players = game:GetService("Players")
  10. local RunService = game:GetService("RunService")
  11. local LocalPlayer = Players.LocalPlayer
  12.  
  13. if not getgenv().Network then
  14. getgenv().Network = {
  15. BaseParts = {};
  16. FakeConnections = {};
  17. Connections = {};
  18. Output = {
  19. Enabled = true;
  20. Prefix = "[NETWORK] ";
  21. Send = function(Type,Output,BypassOutput)
  22. if typeof(Type) == "function" and (Type == print or Type == warn or Type == error) and typeof(Output) == "string" and (typeof(BypassOutput) == "nil" or typeof(BypassOutput) == "boolean") then
  23. if Network["Output"].Enabled or BypassOutput then
  24. Type(Network["Output"].Prefix..Output);
  25. end;
  26. elseif Network["Output"].Enabled then
  27. error(Network["Output"].Prefix.."Output Send Error : Invalid syntax.");
  28. end;
  29. end;
  30. };
  31. LostParts = {};
  32. CharacterRelative = true;
  33. LastCharacter = nil;
  34. TryKeep = true; --loop attempts to
  35. PartOwnership = {
  36. PreMethodSettings = {};
  37. Enabled = false;
  38. };
  39. }
  40.  
  41. Network["Output"].Send(print,": Loading.")
  42.  
  43. Network["RetainPart"] = function(Part,Silent,ReturnFakePart) --function for retaining ownership of unanchored parts
  44. assert(Network["PartOwnership"]["Enabled"], Network["Output"].Prefix.." RetainPart Error : PartOwnership is Disabled.")
  45. assert(typeof(Part) == "Instance" and Part:IsA("BasePart") and not Part:IsGrounded(),Network["Output"].Prefix.."RetainPart Error : Invalid syntax: Arg1 (Part) must be an ungrounded BasePart which is a descendant of workspace.")
  46. if not Part:IsDescendantOf(workspace) then
  47. Network["Output"].Send(error,"RetainPart Error : Invalid syntax: Arg1 (Part) must be an ungrounded BasePart which is a descendant of workspace.")
  48. local Index = table.find(Network["LostParts"],Part)
  49. if Index then
  50. table.remove(Network["LostParts"],Index)
  51. end
  52. return false
  53. end
  54. assert(typeof(Silent) == "boolean" or typeof(Silent) == "nil",Network["Output"].Prefix.."RetainPart Error : Invalid syntax: Arg2 (Silent) must be a boolean or nil.")
  55. assert(typeof(ReturnFakePart) == "boolean" or typeof(ReturnFakePart) == "nil",Network["Output"].Prefix.."RetainPart Error : Invalid syntax: Arg3 (ReturnFakePart) must be a boolean or nil.")
  56. if not table.find(Network["BaseParts"],Part) and not table.find(Network["LostParts"],Part) then
  57. table.insert(Network["BaseParts"],Part)
  58. Part.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0,0)
  59. if not Silent then
  60. Network["Output"].Send(print,"PartOwnership Output : PartOwnership applied to BasePart "..Part:GetFullName()..".")
  61. end
  62. if ReturnFakePart then
  63. local workspaceParts = {}
  64. return FakePart
  65. end
  66. else
  67. Network["Output"].Send(warn,"RetainPart Warning : PartOwnership not applied to BasePart "..Part:GetFullName()..", as it already active.")
  68. return false
  69. end
  70. end
  71.  
  72. Network["RemovePart"] = function(Part,Silent) --function for removing ownership of unanchored part
  73. assert(typeof(Part) == "Instance" and Part:IsA("BasePart"),Network["Output"].Prefix.."RemovePart Error : Invalid syntax: Arg1 (Part) must be a BasePart.")
  74. local Index1 = table.find(Network["BaseParts"],Part)
  75. local Index2 = table.find(Network["LostParts"],Part)
  76. if Index1 then
  77. table.remove(Network["BaseParts"],Index1)
  78. else
  79. if not Silent then
  80. Network["Output"].Send(warn,"RemovePart Warning : BasePart "..Part:GetFullName().." not found in BaseParts table.")
  81. end
  82. return
  83. end
  84. if Index2 then
  85. table.remove(Network["LostParts"],Index2)
  86. end
  87. if not Silent then
  88. Network["Output"].Send(print,"RemovePart Output: PartOwnership removed from BasePart "..Part:GetFullName()..".")
  89. end
  90. end
  91.  
  92. Network["PartOwnership"]["PartCoroutine"] = coroutine.create(function(Part)
  93. if Part:IsDescendantOf(workspace) then
  94. if Network.CharacterRelative then
  95. local Character = Network["LastCharacter"];
  96. if not Character.PrimaryPart then
  97. for _,Inst in pairs(Character:GetDescendants()) do
  98. if Inst:IsA("BasePart") then
  99. Character.PrimaryPart = Inst
  100. break
  101. end
  102. end
  103. end
  104. if Character and Character.PrimaryPart then
  105. local Distance = (Character.PrimaryPart.Position - Part.Position).Magnitude
  106. if Distance > gethiddenproperty(LocalPlayer,"MaximumSimulationRadius") and not isnetworkowner(Part) then
  107. Network["Output"].Send(warn,"PartOwnership Warning : PartOwnership not applied to BasePart "..Part:GetFullName()..", as it is more than "..gethiddenproperty(LocalPlayer,"MaximumSimulationRadius").." studs away.")
  108. Network["RemovePart"](Part)
  109. if not Part:IsGrounded() then
  110. table.insert(Network["LostParts"],Part)
  111. else
  112. Network["Output"].Send(warn,"PartOwnership Warning : PartOwnership not applied to BasePart "..Part:GetFullName()..", as it is grounded.")
  113. end
  114. end
  115. else
  116. Network["Output"].Send(warn,"PartOwnership Warning : PartOwnership not applied to BasePart "..Part:GetFullName()..", as the LocalPlayer Character's PrimaryPart does not exist.")
  117. end
  118. end
  119. Part.AssemblyLinearVelocity = (Part.AssemblyLinearVelocity.Unit+Vector3.new(.01,.01,.01))*(50+math.cos(tick()*10))
  120. else
  121. Network["RemovePart"](Part)
  122. end
  123. end)
  124.  
  125. Network["PartOwnership"]["Enable"] = coroutine.create(function() --creating a thread for network stuff
  126. if not Network["PartOwnership"]["Enabled"] then
  127. Network["PartOwnership"]["Enabled"] = true
  128. Network["PartOwnership"]["PreMethodSettings"].ReplicationFocus = LocalPlayer.ReplicationFocus
  129. LocalPlayer.ReplicationFocus = workspace
  130. Network["PartOwnership"]["PreMethodSettings"].SimulationRadius = gethiddenproperty(LocalPlayer,"SimulationRadius")
  131. Network["PartOwnership"]["Connection"] = RunService.Stepped:Connect(function()
  132. Network["LastCharacter"] = pcall(function() return LocalPlayer.Character end) or Network["LastCharacter"]
  133. sethiddenproperty(LocalPlayer,"SimulationRadius",1/0)
  134. coroutine.wrap(function()
  135. for _,Part in pairs(Network["BaseParts"]) do --loop through parts and do network stuff
  136. coroutine.resume(Network["PartOwnership"]["PartCoroutine"],Part)
  137. --[==[ [[by 4eyes btw]] ]==]--
  138. end
  139. end)()
  140. coroutine.wrap(function()
  141. for _,Part in pairs(Network["LostParts"]) do
  142. Network.RetainPart(Part,true)
  143. end
  144. end)()
  145. end)
  146. Network["Output"].Send(print,"PartOwnership Output : PartOwnership enabled.")
  147. else
  148. Network["Output"].Send(warn,"PartOwnership Output : PartOwnership already enabled.")
  149. end
  150. end)
  151.  
  152. Network["PartOwnership"]["Disable"] = coroutine.create(function()
  153. if Network["PartOwnership"]["Connection"] then
  154. Network["PartOwnership"]["Connection"]:Disconnect()
  155. LocalPlayer.ReplicationFocus = Network["PartOwnership"]["PreMethodSettings"].ReplicationFocus
  156. sethiddenproperty(LocalPlayer,"SimulationRadius",Network["PartOwnership"]["PreMethodSettings"].SimulationRadius)
  157. Network["PartOwnership"]["PreMethodSettings"] = {}
  158. for _,Part in pairs(Network["BaseParts"]) do
  159. Network["RemovePart"](Part)
  160. end
  161. for Index,Part in pairs(Network["LostParts"]) do
  162. table.remove(Network["LostParts"],Index)
  163. end
  164. Network["PartOwnership"]["Enabled"] = false
  165. Network["Output"].Send(print,"PartOwnership Output : PartOwnership disabled.")
  166. else
  167. Network["Output"].Send(warn,"PartOwnership Output : PartOwnership already disabled.")
  168. end
  169. end)
  170.  
  171. Network["Output"].Send(print,": Loaded.")
  172. end
  173. coroutine.resume(Network["PartOwnership"]["Enable"])
  174.  
  175.  
  176. player = game:GetService("Players").LocalPlayer
  177. camera = workspace.CurrentCamera
  178. character = player.Character
  179. local vbreak = false
  180. character.Archivable = true
  181.  
  182. player.Character = nil
  183. player.Character = character:Clone()
  184.  
  185. wait(game:GetService("Players").RespawnTime+.3)
  186.  
  187. character.Humanoid.Health = 0
  188.  
  189.  
  190. stuff = Instance.new("Folder",workspace)
  191. center = Instance.new("Part",stuff)
  192. input = game:GetService("UserInputService")
  193.  
  194. center.Anchored = true
  195. center.Size = Vector3.new(1,1,1)
  196. center.Position = character.Head.Position
  197. center.CanCollide = false
  198. center.Transparency = 1
  199.  
  200. camera.CameraSubject = center
  201.  
  202. points = {}
  203.  
  204. last_pos = character.Head.Position
  205. coroutine.wrap(function()
  206. while task.wait() do
  207. if vbreak == true then break end
  208. center.CFrame = CFrame.new(center.Position) * camera.CFrame.Rotation
  209. if (last_pos - center.Position).magnitude > 1 then
  210. local marker = Instance.new("Part",stuff)
  211. marker.Anchored = true
  212. marker.Size = Vector3.new(1,1,1)
  213. marker.CFrame = CFrame.lookAt(last_pos,center.Position)
  214. marker.CanCollide = false
  215. marker.Transparency = 1
  216. last_pos = center.Position
  217. table.insert(points,marker)
  218. end
  219. if points[#points-9] then
  220. points[#points-9]:Destroy()
  221. table.remove(points,#points-9)
  222. end
  223. end
  224. end)()
  225.  
  226. handles = {}
  227.  
  228. for i,v in pairs(character:GetChildren()) do
  229. if v:IsA("Accessory") then
  230. table.insert(handles,v.Handle)
  231. end
  232. end
  233.  
  234. for i,handle in pairs(handles) do
  235. local number = i-1
  236. handle.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0,0)
  237. Network.RetainPart(handle)
  238. coroutine.wrap(function()
  239. while handle:FindFirstAncestor("Game") do
  240. if points[#points-number] then do
  241. handle.CFrame = points[#points-number].CFrame
  242. end else
  243. handle.CFrame = center.CFrame
  244. end
  245. task.wait()
  246. end
  247. vbreak = true
  248. player.Character = character
  249. end)()
  250. end
  251.  
  252.  
  253. current_position = character.Head.Position
  254. wait(.5)
  255. while wait() do
  256. if vbreak == true then break end
  257. if input:IsKeyDown(Enum.KeyCode.D) then
  258. current_position += camera.CFrame.RightVector * speed
  259. end
  260. if input:IsKeyDown(Enum.KeyCode.A) then
  261. current_position += camera.CFrame.RightVector * -speed
  262. end
  263. if input:IsKeyDown(Enum.KeyCode.W) then
  264. current_position += camera.CFrame.LookVector * speed
  265. end
  266. if input:IsKeyDown(Enum.KeyCode.S) then
  267. current_position += camera.CFrame.LookVector * -speed
  268. end
  269. if input:IsKeyDown(Enum.KeyCode.E) then
  270. current_position += camera.CFrame.UpVector * speed
  271. end
  272. if input:IsKeyDown(Enum.KeyCode.Q) then
  273. current_position += camera.CFrame.UpVector * -speed
  274. end
  275. if input:IsKeyDown(Enum.KeyCode.LeftShift) then do
  276. speed = 1.5
  277. end else
  278. speed = 0.75
  279. end
  280. center.Position = current_position
  281. end
Add Comment
Please, Sign In to add comment