Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.86 KB | None | 0 0
  1. wait(0.5)
  2. local Player = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent) -- CHANGE THIS TO YOUR NAME
  3. local EpicName = Player.Name
  4. local repStorage= game:GetService("ReplicatedStorage")
  5. wait(1)
  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.Sound: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 Mode = Instance.new("StringValue")
  44. Mode.Value = "Slap"
  45. Mode.Name = "Mode"
  46. Mode.Parent = MainFolder
  47.  
  48. local MoveType = Instance.new("StringValue")
  49. MoveType.Name = "MoveType"
  50. MoveType.Value = "Smooth"
  51. MoveType.Parent = MainFolder
  52.  
  53. local Movement = Instance.new("RemoteEvent")
  54. Movement.Name = "Movement"
  55. Movement.Parent = MainFolder
  56.  
  57. local DamageRemote = Instance.new("RemoteEvent")
  58. DamageRemote.Name = "DamageRemote"
  59. DamageRemote.Parent = MainFolder
  60.  
  61. local WeldRemote = Instance.new("RemoteFunction")
  62. WeldRemote.Name = "WeldRemote"
  63. WeldRemote.Parent = MainFolder
  64.  
  65. local StopRemote = Instance.new("RemoteEvent")
  66. StopRemote.Name = "StopRemote"
  67. StopRemote.Parent = MainFolder
  68.  
  69. for i,v in pairs(workspace.Terrain:GetChildren()) do
  70. if v.Name == Player.Name.." tracker" then
  71. v:Destroy()
  72. end
  73. end
  74.  
  75. local RealRoot = Instance.new("Part")
  76. RealRoot.Name = Player.Name.." tracker"
  77. RealRoot.CanCollide = false
  78. RealRoot.Size = NC.HumanoidRootPart.Size
  79. RealRoot.Transparency = 1
  80. RealRoot.Parent = workspace.Terrain
  81. local NV = Instance.new("BodyVelocity")
  82. NV.Name = "DontMoveMeNoob"
  83. NV.Velocity = Vector3.new(0,0,0)
  84. NV.Parent = RealRoot
  85. NV.Changed:Connect(function(v, v2)
  86. if tostring(v) == "Velocity" then
  87. if v2 ~= Vector3.new(0,0,0) then
  88. NV.Velocity = Vector3.new(0,0,0)
  89. end
  90. end
  91. end)
  92. RealRoot:SetNetworkOwner(Player)
  93.  
  94. for i,v in pairs(MouseInfo:GetChildren()) do
  95. v.OnServerEvent:Connect(function(plr, Position, TARG)
  96. mPos.Value = Position
  97. mTarget.Value = TARG
  98. end)
  99. end
  100.  
  101. Mouse.OnServerEvent:Connect(function(plr, request, ...)
  102. Mouse:FireAllClients(request, ...)
  103. end)
  104.  
  105. --[[ Functions --
  106.  
  107. -- SAZERENOS' ARTIFICIAL HEARTBEAT --]]
  108. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  109.  
  110. ArtificialHB = Instance.new("BindableEvent", script)
  111. ArtificialHB.Name = "ArtificialHB"
  112.  
  113. script:WaitForChild("ArtificialHB")
  114.  
  115. frame = Frame_Speed
  116. tf = 0
  117. allowframeloss = false
  118. tossremainder = false
  119. lastframe = tick()
  120. script.ArtificialHB:Fire()
  121.  
  122. game:GetService("RunService").Heartbeat:connect(function(s, p)
  123. tf = tf + s
  124. if tf >= frame then
  125. if allowframeloss then
  126. script.ArtificialHB:Fire()
  127. lastframe = tick()
  128. else
  129. for i = 1, math.floor(tf / frame) do
  130. script.ArtificialHB:Fire()
  131. end
  132. lastframe = tick()
  133. end
  134. if tossremainder then
  135. tf = 0
  136. else
  137. tf = tf - frame * math.floor(tf / frame)
  138. end
  139. end
  140. end)
  141.  
  142. function Swait(NUMBER)
  143. if NUMBER == 0 or NUMBER == nil then
  144. ArtificialHB.Event:wait()
  145. else
  146. for i = 1, NUMBER do
  147. ArtificialHB.Event:wait()
  148. end
  149. end
  150. end
  151.  
  152. function ChangeLoop(Text)
  153. print(Text)
  154. if Text == "Server" then
  155. LoopType.Value = "Server"
  156. elseif Text == "Custom" then
  157. LoopType.Value = "Custom"
  158. elseif Text == "Heartbeat" then
  159. LoopType.Value = "Heartbeat"
  160. elseif Text == "Stepped" then
  161. LoopType.Value = "Stepped"
  162. elseif Text == "RenderStepped" then
  163. LoopType.Value = "RenderStepped"
  164. else
  165. print("LoopType Invalid")
  166. end
  167. end
  168.  
  169. function ChangeMovement(Text)
  170. print(Text)
  171. if Text == "Smooth" then
  172. MoveType.Value = "Smooth"
  173. elseif Text == "Remote" then
  174. MoveType.Value = "Remote"
  175. else
  176. print("MoveType Invalid")
  177. end
  178. end
  179.  
  180. Player.Chatted:Connect(function(msg)
  181. if string.sub(msg,1,9) == "LoopType/" then
  182. ChangeLoop(string.sub(msg, 10))
  183. end
  184. if string.sub(msg,1,9) == "MoveType/" then
  185. ChangeMovement(string.sub(msg, 10))
  186. end
  187. if msg == "/e stop" then
  188. StopRemote:FireAllClients()
  189. wait()
  190. MainFolder:Remove()
  191. script:Remove()
  192. script.Disabled = true
  193. end
  194. end)
  195.  
  196. game:GetService("Players").PlayerAdded:Connect(function(plr)
  197. if plr.Name == EpicName then
  198. plr.Chatted:Connect(function(msg)
  199. if string.sub(msg,1,9) == "LoopType/" then
  200. ChangeLoop(string.sub(msg, 10))
  201. end
  202. if string.sub(msg,1,9) == "MoveType/" then
  203. ChangeMovement(string.sub(msg, 10))
  204. end
  205. if msg == "/e stop" then
  206. StopRemote:FireAllClients()
  207. wait()
  208. MainFolder:Remove()
  209. script:Remove()
  210. script.Disabled = true
  211. end
  212. end)
  213. end
  214. end)
  215.  
  216. -- Damage Functions --
  217.  
  218. function Damage(v)
  219. v.MaxHealth = 100
  220. v.Health = v.Health - 10
  221. end
  222.  
  223. function NewMode(v, v2)
  224. Mode.Value = v
  225. DamageRemote:FireAllClients("Mode", v2)
  226. end
  227.  
  228. function Remove(v)
  229. v:Remove()
  230. end
  231.  
  232. function Destroy(v)
  233. v:Destroy()
  234. end
  235.  
  236. function BreakJoints(v)
  237. v:BreakJoints()
  238. end
  239.  
  240. function ApplyDamage(Humanoid, Damage, DAMAGEMULTIPLIER)
  241. print(Humanoid, Damage, DAMAGEMULTIPLIER)
  242. Damage = Damage * DAMAGEMULTIPLIER
  243. if Humanoid.Health < 2000 then
  244. if Humanoid.Health - Damage > 0 then
  245. Humanoid.Health = Humanoid.Health - Damage
  246. else
  247. Humanoid.Parent:BreakJoints()
  248. end
  249. else
  250. Humanoid.Parent:BreakJoints()
  251. end
  252. end
  253.  
  254. DamageRemote.OnServerEvent:Connect(function(plr, request, ...)
  255. if request == "Mode" then
  256. NewMode(...)
  257. end
  258. if request == "Damage" then
  259. Damage(...)
  260. end
  261. if request == "Remove" then
  262. Remove(...)
  263. end
  264. if request == "Destroy" then
  265. Destroy(...)
  266. end
  267. if request == "BreakJoints" then
  268. BreakJoints(...)
  269. end
  270. if request == "Banish" then
  271. print("SERVER BANISH")
  272. DamageRemote:FireAllClients(request, ...)
  273. end
  274. if request == "ApplyDamage" then
  275. ApplyDamage(...)
  276. end
  277. if request == "Ban" or request == "BruhDimension" then
  278. DamageRemote:FireAllClients(request, ...)
  279. end
  280. end)
  281.  
  282. -- Other --
  283.  
  284. Movement.OnServerEvent:Connect(function(plr, ...)
  285. Movement:FireAllClients(...)
  286. end)
  287.  
  288. local newWeld=function(name,p0,p1,c0,c1)
  289. local w=Instance.new('Weld',p0)
  290. w.Name=name
  291. w.Part0=p0
  292. w.Part1=p1
  293. w.C0=c0
  294. w.C1=c1
  295. return w
  296. end
  297.  
  298. WeldRemote.OnServerInvoke = newWeld
  299.  
  300. -- End Functions --
  301.  
  302. script.Holder.Name = Player.Name
  303. for i,v in pairs(game:GetService("Players"):GetChildren()) do
  304. local NS = script[Player.Name]:Clone()
  305. NS.Parent = v.PlayerGui
  306. end
  307.  
  308. game.Players.PlayerAdded:Connect(function(plr)
  309. repeat Swait() until plr.Character
  310. local NS = script[Player.Name]:Clone()
  311. NS.Parent = plr:WaitForChild("PlayerGui")
  312. end)
  313.  
  314. -- Synced Loop
  315.  
  316. print("Running Server")
  317.  
  318. script.Parent = game:GetService("ServerScriptService")
  319.  
  320. workspace.Terrain.ChildRemoved:Connect(function(v)
  321. Swait(2)
  322. if v == RealRoot then
  323. RealRoot = Instance.new("Part")
  324. RealRoot.Name = Player.Name.." tracker"
  325. RealRoot.CanCollide = false
  326. RealRoot.Size = NC.HumanoidRootPart.Size
  327. RealRoot.Transparency = 1
  328. RealRoot.Parent = workspace.Terrain
  329. NV = Instance.new("BodyVelocity")
  330. NV.Name = "DontMoveMeNoob"
  331. NV.Velocity = Vector3.new(0,0,0)
  332. NV.Parent = RealRoot
  333. NV.Changed:Connect(function(v, v2)
  334. if tostring(v) == "Velocity" then
  335. if v2 ~= Vector3.new(0,0,0) then
  336. NV.Velocity = Vector3.new(0,0,0)
  337. end
  338. end
  339. end)
  340. RealRoot:SetNetworkOwner(Player)
  341. end
  342. end)
  343.  
  344. ArtificialHB.Event:Connect(function()
  345. Player.Character.HumanoidRootPart.CFrame = CFrame.new(10000,10000,0)
  346. end)
  347.  
  348. while true do
  349. ArtificialHB.Event:wait()
  350. local NI = Instance.new("Shirt")
  351. NI.Parent = SyncFolder
  352. end
  353.  
  354. --[[local Mouse = {}
  355.  
  356. do
  357. local Remote = MainFolder.Mouse
  358. local Hits = MainFolder.MouseInfo
  359. local KeyDown = Instance.new("BindableEvent")
  360. local KeyUp = Instance.new("BindableEvent")
  361. local MouseButton1Down = Instance.new("BindableEvent")
  362. local MouseButton1Up = Instance.new("BindableEvent")
  363. local Hit = MainFolder.mHit
  364. local Target = MainFolder.mTarget
  365. Mouse.KeyDown = KeyDown.Event
  366. Mouse.KeyUp = KeyUp.Event
  367. Mouse.Button1Down = MouseButton1Down.Event
  368. Mouse.Button1Up = MouseButton1Up.Event
  369. Remote.OnClientEvent:Connect(function(request, ...)
  370. if request == "KeyDown" then
  371. KeyDown:Fire(...)
  372. end
  373. if request == "KeyUp" then
  374. KeyUp:Fire(...)
  375. end
  376. if request == "MouseButton1Down" then
  377. MouseButton1Down:Fire(...)
  378. end
  379. if request == "MouseButton1Up" then
  380. MouseButton1Up:Fire(...)
  381. end
  382. end)--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement