Advertisement
PasterXIV

Untitled

Jan 1st, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.45 KB | None | 0 0
  1. wait(3)
  2. local Player = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent) -- CHANGE THIS TO YOUR NAME
  3. local repStorage= game:GetService("ReplicatedStorage")
  4. script.Parent = game:GetService("ServerScriptService")
  5. wait(0.5)
  6. script.Parent = game:GetService("ServerScriptService")
  7. local MainFolder = Instance.new("Folder")
  8. MainFolder.Name = Player.Name
  9. MainFolder.Parent = repStorage
  10.  
  11. Player.Character.Archivable = true
  12. local NC = Player.Character:Clone()
  13. NC.Animate:Destroy()
  14. NC.Humanoid.Animator:Destroy()
  15. FF = Instance.new("ForceField")
  16. FF.Visible = false
  17. FF.Parent = NC
  18. NC.Parent = MainFolder
  19.  
  20. local Mouse = Instance.new("RemoteEvent")
  21. Mouse.Name = "Mouse"
  22. Mouse.Parent = MainFolder
  23. local MouseInfo = script.MouseInfo
  24. MouseInfo.Parent = MainFolder
  25.  
  26. local SyncFolder = Instance.new("Folder")
  27. SyncFolder.Name = "Sync"
  28. SyncFolder.Parent = MainFolder
  29.  
  30. local mPos = Instance.new("CFrameValue")
  31. mPos.Name = "mHit"
  32. mPos.Parent = MainFolder
  33.  
  34. local mTarget = Instance.new("ObjectValue")
  35. mTarget.Name = "mTarget"
  36. mTarget.Parent = MainFolder
  37.  
  38. local LoopType = Instance.new("StringValue")
  39. LoopType.Name = "LoopType"
  40. LoopType.Value = "Custom"
  41. LoopType.Parent = MainFolder
  42.  
  43. local MoveType = Instance.new("StringValue")
  44. MoveType.Name = "MoveType"
  45. MoveType.Value = "Smooth"
  46. MoveType.Parent = MainFolder
  47.  
  48. local Movement = Instance.new("RemoteEvent")
  49. Movement.Name = "Movement"
  50. Movement.Parent = MainFolder
  51.  
  52. local DamageRemote = Instance.new("RemoteEvent")
  53. DamageRemote.Name = "DamageRemote"
  54. DamageRemote.Parent = MainFolder
  55.  
  56. local WeldRemote = Instance.new("RemoteFunction")
  57. WeldRemote.Name = "WeldRemote"
  58. WeldRemote.Parent = MainFolder
  59.  
  60. local StopRemote = Instance.new("RemoteEvent")
  61. StopRemote.Name = "StopRemote"
  62. StopRemote.Parent = MainFolder
  63.  
  64. for i,v in pairs(MouseInfo:GetChildren()) do
  65. v.OnServerEvent:Connect(function(plr, Position, TARG)
  66. mPos.Value = Position
  67. mTarget.Value = TARG
  68. end)
  69. end
  70.  
  71. for i,v in pairs(workspace.Terrain:GetChildren()) do
  72. if v.Name == Player.Name.." tracker" then
  73. v:Destroy()
  74. end
  75. end
  76.  
  77. local RealRoot = Instance.new("Part")
  78. RealRoot.Name = Player.Name.." tracker"
  79. RealRoot.CanCollide = false
  80. RealRoot.Size = NC.HumanoidRootPart.Size
  81. RealRoot.Transparency = 1
  82. RealRoot.Parent = workspace.Terrain
  83. local NV = Instance.new("BodyVelocity")
  84. NV.Name = "DontMoveMeNoob"
  85. NV.Velocity = Vector3.new(0,0,0)
  86. NV.Parent = RealRoot
  87. NV.Changed:Connect(function(v, v2)
  88. if tostring(v) == "Velocity" then
  89. if v2 ~= Vector3.new(0,0,0) then
  90. NV.Velocity = Vector3.new(0,0,0)
  91. end
  92. end
  93. end)
  94. RealRoot:SetNetworkOwner(Player)
  95.  
  96. Mouse.OnServerEvent:Connect(function(plr, request, ...)
  97. Mouse:FireAllClients(request, ...)
  98. end)
  99.  
  100. --[[ Functions --
  101.  
  102. -- SAZERENOS' ARTIFICIAL HEARTBEAT --]]
  103. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  104.  
  105. ArtificialHB = Instance.new("BindableEvent", script)
  106. ArtificialHB.Name = "ArtificialHB"
  107.  
  108. script:WaitForChild("ArtificialHB")
  109.  
  110. frame = Frame_Speed
  111. tf = 0
  112. allowframeloss = false
  113. tossremainder = false
  114. lastframe = tick()
  115. script.ArtificialHB:Fire()
  116.  
  117. game:GetService("RunService").Heartbeat:connect(function(s, p)
  118. tf = tf + s
  119. if tf >= frame then
  120. if allowframeloss then
  121. script.ArtificialHB:Fire()
  122. lastframe = tick()
  123. else
  124. for i = 1, math.floor(tf / frame) do
  125. script.ArtificialHB:Fire()
  126. end
  127. lastframe = tick()
  128. end
  129. if tossremainder then
  130. tf = 0
  131. else
  132. tf = tf - frame * math.floor(tf / frame)
  133. end
  134. end
  135. end)
  136.  
  137. function Swait(NUMBER)
  138. if NUMBER == 0 or NUMBER == nil then
  139. ArtificialHB.Event:wait()
  140. else
  141. for i = 1, NUMBER do
  142. ArtificialHB.Event:wait()
  143. end
  144. end
  145. end
  146.  
  147. function ChangeLoop(Text)
  148. print(Text)
  149. if Text == "Server" then
  150. LoopType.Value = "Server"
  151. elseif Text == "Custom" then
  152. LoopType.Value = "Custom"
  153. elseif Text == "Heartbeat" then
  154. LoopType.Value = "Heartbeat"
  155. elseif Text == "Stepped" then
  156. LoopType.Value = "Stepped"
  157. elseif Text == "RenderStepped" then
  158. LoopType.Value = "RenderStepped"
  159. else
  160. print("LoopType Invalid")
  161. end
  162. end
  163.  
  164. function ChangeMovement(Text)
  165. print(Text)
  166. if Text == "Smooth" then
  167. MoveType.Value = "Smooth"
  168. elseif Text == "Remote" then
  169. MoveType.Value = "Remote"
  170. else
  171. print("MoveType Invalid")
  172. end
  173. end
  174.  
  175. Player.Chatted:Connect(function(msg)
  176. if string.sub(msg,1,9) == "LoopType/" then
  177. ChangeLoop(string.sub(msg, 10))
  178. end
  179. if string.sub(msg,1,9) == "MoveType/" then
  180. ChangeMovement(string.sub(msg, 10))
  181. end
  182. if msg == "~stop" then
  183. StopRemote:FireAllClients()
  184. wait()
  185. MainFolder:Remove()
  186. script:Remove()
  187. script.Disabled = true
  188. end
  189. end)
  190.  
  191. -- Damage Functions --
  192.  
  193. DamageRemote.OnServerEvent:Connect(function(plr, request, v)
  194. if request == "BreakJoints" then
  195. pcall(function()
  196. v:BreakJoints()
  197. end)
  198. end
  199. if request == "Remove" then
  200. pcall(function()
  201. v:Remove()
  202. end)
  203. end
  204. end)
  205.  
  206. -- Other --
  207.  
  208. Movement.OnServerEvent:Connect(function(plr, ...)
  209. Movement:FireAllClients(...)
  210. end)
  211.  
  212. local newWeld=function(name,p0,p1,c0,c1)
  213. local w=Instance.new('Weld',p0)
  214. w.Name=name
  215. w.Part0=p0
  216. w.Part1=p1
  217. w.C0=c0
  218. w.C1=c1
  219. return w
  220. end
  221.  
  222. WeldRemote.OnServerInvoke = newWeld
  223.  
  224. -- End Functions --
  225.  
  226. script.Holder.Name = Player.Name
  227. for i,v in pairs(game:GetService("Players"):GetChildren()) do
  228. local NS = script[Player.Name]:Clone()
  229. NS.Parent = v.PlayerGui
  230. end
  231.  
  232. game.Players.PlayerAdded:Connect(function(plr)
  233. repeat Swait() until plr.Character
  234. local NS = script[Player.Name]:Clone()
  235. NS.Parent = plr:WaitForChild("PlayerGui")
  236. end)
  237.  
  238. -- Synced Loop
  239.  
  240. print("Running Server")
  241.  
  242. script.Parent = game:GetService("ServerScriptService")
  243.  
  244. workspace.Terrain.ChildRemoved:Connect(function(v)
  245. Swait(2)
  246. if v == RealRoot then
  247. RealRoot = Instance.new("Part")
  248. RealRoot.Name = Player.Name.." tracker"
  249. RealRoot.CanCollide = false
  250. RealRoot.Size = NC.HumanoidRootPart.Size
  251. RealRoot.Transparency = 1
  252. RealRoot.Parent = workspace.Terrain
  253. NV = Instance.new("BodyVelocity")
  254. NV.Name = "DontMoveMeNoob"
  255. NV.Velocity = Vector3.new(0,0,0)
  256. NV.Parent = RealRoot
  257. NV.Changed:Connect(function(v, v2)
  258. if tostring(v) == "Velocity" then
  259. if v2 ~= Vector3.new(0,0,0) then
  260. NV.Velocity = Vector3.new(0,0,0)
  261. end
  262. end
  263. end)
  264. RealRoot:SetNetworkOwner(Player)
  265. end
  266. end)
  267.  
  268. ArtificialHB.Event:Connect(function()
  269. Player.Character.HumanoidRootPart.CFrame = CFrame.new(10000,10000,0)
  270. end)
  271.  
  272. while true do
  273. ArtificialHB.Event:wait()
  274. local NI = Instance.new("Shirt")
  275. NI.Parent = SyncFolder
  276. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement