Advertisement
ryghost

Functions

Aug 19th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Functions = {}
  2. local Environment = Arsenic.Environment
  3.  
  4. Functions.Local = {}
  5. Functions.Players = {}
  6. Functions.Server = {}
  7. Functions.Vehicles = {}
  8. Functions.Particles = {}
  9. Functions.Banishment = {}
  10. Functions.Weapons = {}
  11. Functions.Structures = {}
  12. Functions.Cloning = {}
  13.  
  14. local Local = Functions.Local
  15. local Players = Functions.Players
  16. local Server = Functions.Server
  17. local Vehicles = Functions.Vehicles
  18. local Particles = Functions.Particles
  19. local Banishment = Functions.Banishment
  20. local Weapons = Functions.Weapons
  21. local Structures = Functions.Structures
  22. local Cloning = Functions.Cloning
  23.  
  24. local function FindVest(player)
  25. for i,v in next, player.Character:GetDescendants() do
  26. if v.Name == 'thisisarmor' then
  27. return v.Parent
  28. end
  29. end
  30. end
  31.  
  32. local function WaitAsync(condition)
  33. repeat wait() until condition
  34. end
  35.  
  36. -- Local
  37.  
  38. function Local.SetWalkSpeed(value)
  39. Arsenic.Globals.walkbase = value
  40. Arsenic.Client.Character.Humanoid.WalkSpeed = value
  41. end
  42.  
  43. function Local.SetJumpPower(value)
  44. Arsenic.Client.Character.Humanoid.JumpPower = value
  45. end
  46.  
  47. function Local.SetZoom(value)
  48. Arsenic.Client.CameraMaxZoomDistance = value
  49. end
  50.  
  51. function Local.SetFog(value)
  52. game:GetService("Lighting").FogEnd = value
  53. end
  54.  
  55. local LastSpectated
  56. function Local.Spectate(player)
  57. if LastSpectated then
  58. Arsenic.Data[LastSpectated.Name].Toggles.Spectate = false
  59. end
  60. Arsenic.Data[player.Name].Toggles.Spectate = true
  61. LastSpectated = player
  62. workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
  63. end
  64.  
  65. function Local.Glowstick(toggle)
  66. local Character = Arsenic.Client.playerstats.character
  67. local Skin = game:GetService('ReplicatedStorage').skins[Character.skin.Value]
  68. local OldSkin = Skin.Value
  69. local OldVest = Character.vestcolor.Value
  70.  
  71. Arsenic.Loops.Glowstick = toggle
  72.  
  73. Arsenic('VehichleLightsSet', Arsenic.Client.Character, 'Neon', 0)
  74. Arsenic.Globals.VehichleLightsSet(Arsenic.Client.Character, 'Neon', 0)
  75.  
  76. if not toggle then
  77. Arsenic('VehichleLightsSet', Arsenic.Client.Character, 'SmoothPlastic', 0)
  78. Arsenic.Globals.VehichleLightsSet(Arsenic.Client.Character, 'SmoothPlastic', 0)
  79. return
  80. end
  81.  
  82. while Arsenic.Loops.Glowstick and wait(1) do
  83. Arsenic('ChangeValue', Skin, BrickColor.random())
  84. Arsenic.Remote.CheckSkin:FireServer()
  85. Arsenic('ChangeValue', Skin, Old)
  86. Arsenic('ChangeValue', Character.vestcolor, math.random(1, 26))
  87. Arsenic.Remote.CheckVest:FireServer()
  88. end
  89. end
  90.  
  91. function Local.Fly(toggle)
  92. Arsenic.Loops.Flying = toggle
  93. repeat wait()
  94. until Arsenic.Client and Arsenic.Client.Character and Arsenic.Client.Character:FindFirstChild("Torso") and Arsenic.Client.Character:findFirstChild("Humanoid")
  95. local mouse = Arsenic.Client:GetMouse()
  96. repeat wait() until mouse
  97. local plr = Arsenic.Client
  98. local torso = plr.Character.Torso
  99. local deb = true
  100. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  101. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  102. local speed = 0
  103.  
  104. local function Fly()
  105. local bg = Instance.new("BodyGyro", torso)
  106. bg.P = 9e4
  107. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  108. bg.cframe = torso.CFrame
  109. local bv = Instance.new("BodyVelocity", torso)
  110. bv.velocity = Vector3.new(0,0.1,0)
  111. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  112. repeat wait()
  113. plr.Character.Humanoid.PlatformStand = true
  114. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  115. speed = speed+.5+(speed/Arsenic.Variables.FlySpeed)
  116. if speed > Arsenic.Variables.FlySpeed then
  117. speed = Arsenic.Variables.FlySpeed
  118. end
  119. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  120. speed = speed-1
  121. if speed < 0 then
  122. speed = 0
  123. end
  124. end
  125. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  126. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  127. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  128. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  129. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  130. else
  131. bv.velocity = Vector3.new(0,0.1,0)
  132. end
  133. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/Arsenic.Variables.FlySpeed),0,0)
  134. until not Arsenic.Loops.Flying
  135. ctrl = {f = 0, b = 0, l = 0, r = 0}
  136. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  137. speed = 0
  138. bg:Destroy()
  139. bv:Destroy()
  140. plr.Character.Humanoid.PlatformStand = false
  141. end
  142. mouse.KeyDown:connect(function(key)
  143. if key:lower() == "w" then
  144. ctrl.f = 1
  145. elseif key:lower() == "s" then
  146. ctrl.b = -1
  147. elseif key:lower() == "a" then
  148. ctrl.l = -1
  149. elseif key:lower() == "d" then
  150. ctrl.r = 1
  151. end
  152. end)
  153. mouse.KeyUp:connect(function(key)
  154. if key:lower() == "w" then
  155. ctrl.f = 0
  156. elseif key:lower() == "s" then
  157. ctrl.b = 0
  158. elseif key:lower() == "a" then
  159. ctrl.l = 0
  160. elseif key:lower() == "d" then
  161. ctrl.r = 0
  162. end
  163. end)
  164. Fly()
  165. end
  166.  
  167. function Local.VS50Walk(toggle)
  168. Arsenic.Loops.VS50Walk = toggle
  169. while Arsenic.Loops.VS50Walk and wait() do
  170. Arsenic.Remote.PlaceMaterial:FireServer('VS50Placed', (Arsenic.Client.Character.HumanoidRootPart.Position - game:GetService( 'Lighting').Materials.VS50Placed.Head.Position) - Vector3.new(0, 2.9, 0), true)
  171. end
  172. end
  173.  
  174. function Local.TM46Walk(toggle)
  175. Arsenic.Loops.TM46Walk = toggle
  176. while Arsenic.Loops.TM46Walk and wait() do
  177. Arsenic.Remote.PlaceMaterial:FireServer('TM46Placed', (Arsenic.Client.Character.HumanoidRootPart.Position - game:GetService( 'Lighting').Materials.TM46Placed.Head.Position) - Vector3.new(0, 2.9, 0), true)
  178. end
  179. end
  180.  
  181. function Local.C4Walk(toggle)
  182. Arsenic.Loops.C4Walk = toggle
  183. while Arsenic.Loops.C4Walk and wait() do
  184. Arsenic.Remote.PlaceMaterial:FireServer('C4Placed', (Arsenic.Client.Character.HumanoidRootPart.Position - game:GetService('Lighting').Materials.C4Placed.Head.Position) - Vector3.new(0, 2.9, 0), true)
  185. end
  186. end
  187.  
  188. function Local.Autoheal(toggle)
  189. if toggle then
  190. Arsenic.Events.Autoheal = Arsenic.Client.Character.Humanoid.Changed:Connect(function(p)
  191. if p == 'Health' then
  192. Arsenic('AddHealth', 100, 0)
  193. end
  194. end)
  195. else
  196. if Arsenic.Events.Autoheal then
  197. Arsenic.Events.Autoheal:Disconnect()
  198. end
  199. end
  200. end
  201.  
  202. -- Players
  203.  
  204. function Players.SetPlayers(player, value)
  205. Arsenic('ChangeValue', player.playerstats.PlayerKill.Aggressive, value)
  206. end
  207.  
  208. function Players.SetZombies(player, value)
  209. Arsenic('ChangeValue', player.playerstats.ZombieKill.Military, value)
  210. end
  211.  
  212. function Players.SetDays(player, value)
  213. Arsenic('ChangeValue', player.playerstats.Days, value)
  214. end
  215.  
  216. function Players.SetHunger(player, value)
  217. Arsenic('ChangeValue', player.playerstats.Hunger, value)
  218. end
  219.  
  220. function Players.SetThirst(player, value)
  221. Arsenic('ChangeValue', player.playerstats.Thirst, value)
  222. end
  223.  
  224. function Players.SetStamina(player, value)
  225. Arsenic('ChangeValue', player.Backpack.GlobalFunctions.Stamina, value)
  226. end
  227.  
  228. function Players.CombatLog(player, value)
  229. Arsenic('ChangeValue', player.playerstats.combat, value)
  230. end
  231.  
  232. function Players.ShowVest(player, toggle)
  233. local Character = player.Character
  234. local Vest = FindVest(player)
  235.  
  236. Arsenic('ChangeParent', Vest.thisisarmor, Character)
  237. Character:WaitForChild('thisisarmor')
  238. if not toggle then
  239. Arsenic('VehichleLightsSet', Vest, 'SmoothPlastic', 1)
  240. Arsenic('ChangeParent', Character:FindFirstChild('thisisarmor'), Vest)
  241. return
  242. end
  243.  
  244. Arsenic('VehichleLightsSet', Vest, 'SmoothPlastic', 0)
  245. Arsenic('ChangeParent', Character:FindFirstChild('thisisarmor'), Vest)
  246. end
  247.  
  248. function Players.ShowFace(player, toggle)
  249. local PlayerCharacter = player.Character
  250.  
  251. if not toggle then
  252. Arsenic('ChangeParent', PlayerCharacter.Head.face, PlayerCharacter)
  253. return
  254. end
  255.  
  256. Arsenic('ChangeParent', PlayerCharacter.face, PlayerCharacter.Head)
  257. end
  258.  
  259. function Players.FaceSwap(player, target)
  260. local PlayerFace = player.Character.Head.face
  261. local TargetFace = target.Character.Head.face
  262. Arsenic('ChangeParent', PlayerFace, target.Character.Head)
  263. Arsenic('ChangeParent', TargetFace, player.Character.Head)
  264. end
  265.  
  266. function Players.Material(player, value)
  267. local Character = player.Character
  268. local OldTransparency = Character.Head.Transparency
  269. Arsenic('VehichleLightsSet', Character, value, OldTransparency)
  270. Arsenic.Globals.VehichleLightsSet(Character, value, OldTransparency)
  271. end
  272.  
  273. function Players.Visibility(player, value)
  274. local Character = player.Character
  275. local PlayerVest = FindVest(player)
  276. local OldMaterial = Character.Head.Material
  277. local VestCheck = PlayerVest.thisisarmor
  278. Arsenic('VehichleLightsSet', Character, OldMaterial, value)
  279. Arsenic.Globals.VehichleLightsSet(Character, OldMaterial, value)
  280. Arsenic('ChangeParent', VestCheck, Character)
  281. Arsenic('ChangeParent', VestCheck, PlayerVest)
  282. end
  283.  
  284. function Players.Shirt(player, id)
  285. local ClientShirt = Arsenic.Client.playerstats.character.shirt.ObjectID.Shirt
  286. local OldClientValue = ClientShirt.Value
  287. Arsenic("ChangeValue", ClientShirt, id)
  288. Arsenic.Remote.CheckShirt:FireServer()
  289.  
  290. wait(0.25)
  291.  
  292. if player ~= Arsenic.Client then
  293. local ClientShirtObject = Arsenic.Client.Character.GameShirt
  294. local PlayerShirtObject = player.Character.GameShirt
  295.  
  296. Arsenic("ChangeParent", ClientShirtObject, player.Character)
  297. Arsenic("ChangeParent", PlayerShirtObject, Arsenic.Client.Character)
  298. Arsenic("ChangeValue", player.playerstats.character.shirt.ObjectID.Shirt, ClientShirt.Value)
  299. Arsenic("ChangeValue", ClientShirt, OldClientValue)
  300. Arsenic.Remote.CheckShirt:FireServer()
  301. end
  302. end
  303.  
  304. function Players.Pants(player, id)
  305. local ClientPants = Arsenic.Client.playerstats.character.pants.ObjectID.Pants
  306. local OldClientValue = ClientPants.Value
  307. Arsenic("ChangeValue", ClientPants, id)
  308. Arsenic.Remote.CheckPants:FireServer()
  309.  
  310. wait(0.25)
  311.  
  312. if player ~= Arsenic.Client then
  313. local ClientPantsObject = Arsenic.Client.Character.GamePants
  314. local PlayerPantsObject = player.Character.GamePants
  315.  
  316. Arsenic("ChangeParent", ClientPantsObject, player.Character)
  317. Arsenic("ChangeParent", PlayerPantsObject, Arsenic.Client.Character)
  318. Arsenic("ChangeValue", player.playerstats.character.pants.ObjectID.Pants, ClientPants.Value)
  319. Arsenic("ChangeValue", ClientPants, OldClientValue)
  320. Arsenic.Remote.CheckPants:FireServer()
  321. end
  322. end
  323.  
  324. function Players.Teleport(target, destination, location)
  325. local Stamina = target.Backpack.GlobalFunctions.Stamina
  326. local OldValue = Stamina.Value
  327.  
  328. Arsenic('ChangeValue', Stamina, 0)
  329. Arsenic.Remote.HurtZombie:FireServer(target.Character, 15)
  330. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', target.Character, '', '', '')
  331. Arsenic.Remote.AddClothing:FireServer('driven', target.Character, '', '', '')
  332. Arsenic.Remote.AddClothing:FireServer('SeatPoint', target.Character.Torso, '', '', '')
  333.  
  334. target.Character:WaitForChild('IsBuildingMaterial')
  335. target.Character:WaitForChild('driven')
  336. target.Character.Torso:WaitForChild('SeatPoint')
  337. Arsenic.Remote.ReplicateModel:FireServer(target.Character, target.Character.Head.CFrame + Vector3.new(0, 50, 0))
  338.  
  339. if location then
  340. Arsenic.Remote.ReplicateModel:FireServer(target.Character, destination.CFrame)
  341. else
  342. Arsenic.Remote.ReplicateModel:FireServer(target.Character, destination.Character.Head.CFrame)
  343. end
  344.  
  345. wait(2)
  346.  
  347. Arsenic('ChangeParent', target.Character.IsBuildingMaterial, nil)
  348. Arsenic('ChangeParent', target.Character.driven, nil)
  349. Arsenic('ChangeParent', target.Character.Torso.SeatPoint, nil)
  350. Arsenic('ChangeValue', Stamina, OldValue)
  351. end
  352.  
  353. function Players.SetAdmin(player, toggle)
  354. Arsenic.Storage.Admins[player.Name] = toggle
  355. end
  356.  
  357. function Players.SetMod(player, toggle)
  358. Arsenic.Storage.Mods[player.Name] = toggle
  359. end
  360.  
  361. -- <ext>
  362.  
  363. local ItemCache = (function()
  364. local Ret = {}
  365. for i,v in next, game:GetService('Lighting').LootDrops:GetChildren() do
  366. Ret[v.Name] = i
  367. end
  368. return Ret
  369. end)()
  370.  
  371. -- Server
  372.  
  373. function Server.LootRate(value)
  374. Arsenic.Remote.ChangeLootModifier:FireServer(value)
  375. end
  376.  
  377. function Server.Spawn(player, loot, amount)
  378. local Lighting = game:GetService("Lighting")
  379. local LootDrops = Lighting.LootDrops
  380. local Spawn = loot.Name
  381.  
  382. if Environment.Place == 'Mods' then
  383. Spawn = loot
  384. end
  385.  
  386. local Position = player.Character.HumanoidRootPart.Position - loot.PrimaryPart.Position
  387.  
  388. if amount > 30 then
  389. amount = 30
  390. end
  391.  
  392. for i = 1, amount do
  393. Arsenic('ChangeParent', loot, Lighting.Materials)
  394. Arsenic.Remote.PlaceMaterial:FireServer(Spawn, Position + Vector3.new(math.random(-4, 4), 0, math.random(-4, 4)), false, false)
  395. Arsenic('ChangeParent', loot, LootDrops)
  396. end
  397. end
  398.  
  399. function Server.ClearLoot()
  400. for i,v in next, workspace:GetChildren() do
  401. if ItemCache[v.Name] then
  402. Arsenic('ChangeParent', v, nil)
  403. end
  404. end
  405. end
  406.  
  407. -- Banishment
  408.  
  409. function Banishment.Kill(player)
  410. Arsenic('ChangeParent', player.Character.Head, nil)
  411. end
  412.  
  413. function Banishment.Loopkill(player)
  414. Arsenic('ChangeParent', player.Character.Head, nil)
  415. Arsenic.Storage.Loopkill[player] = true
  416. end
  417.  
  418. function Banishment.Unloopkill(player)
  419.  
  420. end
  421.  
  422. function Banishment.Trip(player)
  423. Arsenic.Remote.HurtZombie:FireServer(player.Character, 0)
  424. end
  425.  
  426. function Banishment.Kick(player)
  427. Arsenic('ChangeParent', player, nil)
  428. end
  429.  
  430. function Banishment.Ban(player)
  431. Arsenic.Storage.Bans[player.Name] = true
  432. Banishment.Kick(player)
  433. end
  434.  
  435. function Banishment.Unban(player)
  436. Arsenic.Storage.Bans[player] = nil
  437. end
  438.  
  439. function Banishment.Punish(player)
  440. Arsenic('ChangeParent', player.Character, game:GetService('ReplicatedStorage'))
  441. end
  442.  
  443. function Banishment.Unpunish(player)
  444. Arsenic('ChangeParent', game:GetService('ReplicatedStorage'):FindFirstChild(player.Name, true), workspace)
  445. end
  446.  
  447. function Banishment.Crash(player)
  448. Arsenic.Remote.AddClothing:FireServer('PermanentBan', player, '', '', '')
  449. end
  450.  
  451. function Banishment.Explode(player)
  452. local Offset = player.Character.HumanoidRootPart.Position - game:GetService('Lighting').Materials.C4Placed.Head.Position
  453. for i = 1, 4 do
  454. Arsenic.Remote.PlaceMaterial:FireServer('C4Placed', Offset + Vector3.new(0, -2.9, 0), true)
  455.  
  456. local C4Added, C4
  457. C4Added = workspace.ChildAdded:Connect(function(child)
  458. if child.Name == 'C4Placed' and child:WaitForChild('Owner').Value == Arsenic.Client.Name then
  459. C4 = child
  460. Arsenic.Remote.Detonate:FireServer(C4)
  461. C4Added:Disconnect()
  462. end
  463. end)
  464.  
  465. repeat wait() until C4
  466.  
  467. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', C4, '', '', '')
  468. Arsenic.Remote.ReplicateModel:FireServer(C4, player.Character.Head.CFrame + CFrame.new(0, 1, 0).p)
  469.  
  470. C4Added:Disconnect()
  471. end
  472. end
  473.  
  474. function Banishment.SetHumanoid(player, toggle)
  475. if toggle then
  476. Arsenic('ChangeParent', player.Humanoid, player.Character)
  477. return
  478. end
  479.  
  480. Arsenic('ChangeParent', player.Character.Humanoid, player)
  481. end
  482.  
  483. -- Vehicles
  484.  
  485. function Vehicles.Speed(vehicle, value)
  486. Arsenic('ChangeValue', vehicle.Stats.MaxSpeed, value)
  487. Arsenic('ChangeValue', vehicle.Stats.MaxSpeed.Offroad, value)
  488. end
  489.  
  490. function Vehicles.God(vehicle)
  491. for i,v in next, vehicle.Stats:GetDescendants() do
  492. if not string.find(v.Name, 'd') then
  493. Arsenic('ChangeValue', v, 133742069)
  494. end
  495. end
  496. end
  497.  
  498. function Vehicles.Explode(vehicle)
  499. Arsenic('ChangeValue', vehicle.Stats.Engine, 0)
  500. end
  501.  
  502. function Vehicles.Teleport(player, vehicle)
  503. local Stamina = player.Backpack.GlobalFunctions.Stamina
  504. local OldValue = Stamina.Value
  505.  
  506. Arsenic('ChangeValue', Stamina, 0)
  507. Arsenic.Remote.HurtZombie:FireServer(player.Character, 15)
  508. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', player.Character, '', '', '')
  509. Arsenic.Remote.AddClothing:FireServer('driven', player.Character, '', '', '')
  510. Arsenic.Remote.AddClothing:FireServer('SeatPoint', player.Character.Torso, '', '', '')
  511.  
  512. player.Character:WaitForChild('IsBuildingMaterial')
  513. player.Character:WaitForChild('driven')
  514. player.Character.Torso:WaitForChild('SeatPoint')
  515.  
  516. Arsenic.Remote.ReplicateModel:FireServer(player.Character, player.Character.Head.CFrame + Vector3.new(0, 50, 0))
  517. Arsenic.Remote.ReplicateModel:FireServer(player.Character, vehicle.Essentials.Engine.CFrame + Vector3.new(10, 0, 10))
  518.  
  519. wait(2)
  520.  
  521. Arsenic('ChangeParent', player.Character.IsBuildingMaterial, nil)
  522. Arsenic('ChangeParent', player.Character.driven, nil)
  523. Arsenic('ChangeParent', player.Character.Torso.SeatPoint, nil)
  524. Arsenic('ChangeValue', Stamina, OldValue)
  525. end
  526.  
  527. function Vehicles.Bring(vehicle, player)
  528. if not vehicle.PrimaryPart:FindFirstChild('IsBuildingMaterial', true) then
  529. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', vehicle.PrimaryPart, '', '', '')
  530. end
  531. vehicle.PrimaryPart:WaitForChild('IsBuildingMaterial')
  532. Arsenic.Remote.ReplicatePart:FireServer(vehicle.PrimaryPart, Arsenic.Client.Character.HumanoidRootPart.CFrame + Vector3.new(math.random(-20, 20), 0, math.random(-20, 20)))
  533. end
  534.  
  535. function Vehicles.Clone(vehicle, player)
  536. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', vehicle, '', '', '')
  537. Arsenic('ChangeParent', vehicle, game:GetService('Lighting').Materials)
  538.  
  539. local Vehicle = vehicle.Name
  540. if Environment.Place == 'Mods'then
  541. Vehicle = vehicle
  542. end
  543.  
  544. workspace.Remote.PlaceMaterial:FireServer(Vehicle, (player.Character.HumanoidRootPart.Position - vehicle.Essentials.Base.Position) + Vector3.new(math.random(-20, 20), 0, math.random(-20, 20)), true)
  545. Arsenic('ChangeParent', vehicle.IsBuildingMaterial, nil)
  546. Arsenic('ChangeParent', vehicle, workspace.Vehicles)
  547.  
  548. local Cloned = workspace:WaitForChild(vehicle.Name)
  549.  
  550. for i,v in next, Cloned:GetDescendants() do
  551. if v.Name == 'SeatWeld' or v.Name == 'IsBuildingMaterial' then
  552. Arsenic('ChangeParent', v, nil)
  553. end
  554. end
  555.  
  556. Arsenic('ChangeParent', Cloned, workspace.Vehicles)
  557. end
  558.  
  559. function Vehicles.Material(vehicle, material)
  560. local OldParent = {}
  561. local Opacity = vehicle.Wheels.RBWheel.Wheel.Transparency
  562.  
  563. for i,v in next, vehicle('GetDescendants') do
  564. if v:IsA('Model') then
  565. OldParent[v] = v.Parent
  566. Arsenic('ChangeParent', v, vehicle.Essentials)
  567. if v.Name ~= 'Rails' or v.Name ~= 'Icons' then
  568. Arsenic('VehichleLightsSet', v, material, Opacity)
  569. end
  570. end
  571. end
  572.  
  573. wait(1)
  574.  
  575. for i,v in next, OldParent do
  576. Arsenic('ChangeParent', i, v)
  577. end
  578. end
  579.  
  580. function Vehicles.Opacity(vehicle, opacity)
  581. local OldParent = {}
  582. local Material = vehicle.Wheels.RBWheel.Wheel.Material
  583.  
  584. for i,v in next, vehicle:GetDescendants() do
  585. if v:IsA('Model') then
  586. OldParent[v] = v.Parent
  587. Arsenic('ChangeParent', v, vehicle.Essentials)
  588. if v.Name ~= 'Rails' or v.Name ~= 'Icons' then
  589. Arsenic('VehichleLightsSet', v, Material, opacity)
  590. end
  591. end
  592. end
  593.  
  594. wait(1)
  595.  
  596. for i,v in next, OldParent do
  597. Arsenic('ChangeParent', i, v)
  598. end
  599. end
  600.  
  601. function Vehicles.Break(vehicle)
  602. for i,v in next, vehicle('GetDescendants') do
  603. if v:IsA('Weld') then
  604. Arsenic('ChangeParent', v, nil)
  605. end
  606. end
  607. end
  608.  
  609. function Vehicles.Remove(vehicle)
  610. if vehicle.Parent == workspace.Vehicles then
  611. Arsenic('ChangeParent', vehicle, game:GetService('ReplicatedStorage').Transfer)
  612. end
  613. end
  614.  
  615. function Vehicles.Replenish(vehicle)
  616. if vehicle.Parent == game:GetService('ReplicatedStorage').Transfer then
  617. Arsenic('ChangeParent', vehicle, workspace.Vehicles)
  618. end
  619. end
  620.  
  621. -- Particles
  622.  
  623. function Particles.Sparkles(player)
  624. local Materials = game:GetService('Lighting').Materials
  625. local Tip = Materials.RoadFlareLit.Tip
  626. local Sparkles = Tip:WaitForChild('Sparkles')
  627. Arsenic('ChangeParent', Sparkles, Materials.VS50Placed)
  628. Materials.VS50Placed:WaitForChild('Sparkles')
  629. Arsenic.Remote.PlaceMaterial:FireServer((function()
  630. if Environment.Place == 'Mods' then
  631. return game:GetService('Lighting').Materials.VS50Placed
  632. end
  633. return game:GetService('Lighting').Materials.VS50Placed.Name
  634. end)(), Vector3.new(9e9, 9e9, 9e9), true)
  635. Arsenic('ChangeParent', Materials.VS50Placed:WaitForChild('Sparkles'), Tip)
  636. for i,v in next, workspace:GetChildren() do
  637. if v.Name == 'VS50Placed' and v:FindFirstChild('Sparkles', true)then
  638. Arsenic('ChangeParent', v.Sparkles, player.Character.Torso)
  639. Arsenic('ChangeParent', v, nil)
  640. end
  641. end
  642. end
  643.  
  644. function Particles.Fire(player)
  645. local Materials = game:GetService('Lighting').Materials
  646. local Thing = Materials.Fireplace.Thing
  647. local FireEffect = Thing:WaitForChild('FireEffect')
  648. Arsenic.Remote.SwitchEnabled:FireServer(true, FireEffect)
  649. Arsenic('ChangeParent', FireEffect, Materials.VS50Placed)
  650. Arsenic.Remote.PlaceMaterial:FireServer((function()
  651. if Environment.Place == 'Mods' then
  652. return Lighting.Materials.VS50Placed
  653. end
  654. return Lighting.Materials.VS50Placed.Name
  655. end)(), Vector3.new(9e9, 9e9, 9e9), true)
  656. Arsenic('ChangeParent', Materials.VS50Placed:WaitForChild('FireEffect'), Thing)
  657. for i,v in next, workspace:GetChildren() do
  658. if v.Name == 'VS50Placed' and v:FindFirstChild('FireEffect', true)then
  659. Arsenic('ChangeParent', v.FireEffect, player.Character.Torso)
  660. Arsenic('ChangeParent', v, nil)
  661. end
  662. end
  663. Arsenic.Remote.SwitchEnabled:FireServer(false, FireEffect)
  664. end
  665.  
  666. function Particles.Smoke(player)
  667. local Lighting = game:GetService("Lighting")
  668. local Materials = Lighting.Materials
  669. local BuildingSmoke = Lighting:WaitForChild('BuildingSmoke')
  670. Arsenic('ChangeParent', BuildingSmoke, Materials.VS50Placed)
  671. Arsenic.Remote.PlaceMaterial:FireServer((function()
  672. if Environment.Place == 'Mods' then
  673. return Lighting.Materials.VS50Placed
  674. end
  675. return Lighting.Materials.VS50Placed.Name
  676. end)(), Vector3.new(9e9, 9e9, 9e9), true)
  677. wait(1)
  678. Arsenic('ChangeParent', Materials.VS50Placed:WaitForChild('BuildingSmoke'), Lighting)
  679. for i,v in next, workspace:GetChildren() do
  680. if v.Name == 'VS50Placed' and v:FindFirstChild('BuildingSmoke', true)then
  681. Arsenic('ChangeParent', v.BuildingSmoke.SmokeRemoval, nil)
  682. Arsenic('ChangeParent', v.BuildingSmoke, player.Character.Torso)
  683. Arsenic('ChangeParent', v, nil)
  684. end
  685. end
  686. end
  687.  
  688. function Particles.Remove(player, particle)
  689. for i,v in next, player.Character.Torso:GetChildren() do
  690. if v.Name == particle then
  691. Arsenic('ChangeParent', v, nil)
  692. end
  693. end
  694. end
  695.  
  696. -- Weapons
  697.  
  698. function Weapons.SetSpread(weapon, amount)
  699. Environment.SetUpvalue(getsenv(weapon.Shooter).Fire, 'a', amount)
  700. end
  701.  
  702. function Weapons.FireRate(weapon, amount)
  703. getsenv(weapon.Shooter).rato = amount
  704. weapon.Stats.Action.Original.Value = 3
  705. end
  706.  
  707. function Weapons.SetRecoil(player, weapon, amount)
  708. Arsenic('ChangeValue', player.Backpack[weapon.Name].Stats.Recoil, Arsenic.Globals.Obfuscate(amount))
  709. end
  710.  
  711. function Weapons.SetAmmo(player, amount)
  712. for i,v in next, player.playerstats.slots:GetDescendants() do
  713. if v.Name == 'Clip' then
  714. Arsenic('ChangeValue', v.MaxClip, amount)
  715. Arsenic('ChangeValue', v, Arsenic.Globals.Obfuscate(amount))
  716. end
  717. end
  718. end
  719.  
  720. function Weapons.RefillAmmo(player)
  721. for i,v in next, player.playerstats.slots('GetDescendants') do
  722. if v.Name == 'Clip' then
  723. Arsenic('ChangeValue', v, Arsenic.Globals.Obfuscate(v.MaxClip.Value))
  724. end
  725. end
  726. end
  727.  
  728. -- Structures
  729.  
  730. local TrussInstance = (function()
  731. local Lighting = game:GetService('Lighting')
  732. if Environment.Place == 'Mods' then
  733. if not Lighting:FindFirstChild('Materials') then
  734. return Lighting.materials.Material7.Collect7
  735. end
  736. return Lighting.Materials.MetalTruss
  737. end
  738. return 'MetalTruss'
  739. end)()
  740.  
  741. if not game:GetService("ReplicatedStorage"):FindFirstChild('Arsenic_Trusses', true) then
  742. Arsenic.Remote.AddClothing:FireServer('Arsenic_Trusses', game:GetService('ReplicatedStorage'), '', '','')
  743. for i = 1, 90 do
  744. Arsenic.Remote.PlaceMaterial:FireServer(TrussInstance, Vector3.new(9e9, 9e9, 9e9), false, true)
  745. wait()
  746. end
  747. end
  748.  
  749. local BuildingParts = {
  750. Truss = {Size = Vector3.new(2, 8, 2)}
  751. }
  752.  
  753. local function LoadTrusses()
  754. for i,v in next, workspace:GetChildren() do
  755. if v:IsA('TrussPart') and v:FindFirstChild('IsBuildingMaterial', true) then
  756. for k,x in next, BuildingParts do
  757. if x.Size == v.Size then
  758. x[v] = true
  759. end
  760. end
  761. end
  762. end
  763. end
  764.  
  765. function Structures.Truss(player, x, y, z, diameter)
  766. LoadTrusses()
  767. local idx = 0
  768. for i,v in next, BuildingParts.Truss do
  769. if idx == 360 then break end
  770. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(idx * x, idx * y, idx * z) * CFrame.new(0, 0, diameter))
  771. idx = idx + 1
  772. end
  773. end
  774.  
  775. function Structures.TrussRX(player, x, y, z, diameter)
  776. LoadTrusses()
  777. local idx = 0
  778. for i,v in next, BuildingParts.Truss do
  779. if idx == 360 then break end
  780. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(idx) * x, idx * y, idx * z) * CFrame.new(0, 0, diameter))
  781. idx = idx + 1
  782. end
  783. end
  784.  
  785. function Structures.TrussRY(player, x, y, z, diameter)
  786. LoadTrusses()
  787. local idx = 0
  788. for i,v in next, BuildingParts.Truss do
  789. if idx == 360 then break end
  790. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(idx * x, math.rad(idx) * y, idx * z) * CFrame.new(0, 0, diameter))
  791. idx = idx + 1
  792. end
  793. end
  794.  
  795. function Structures.TrussRZ(player, x, y, z, diameter)
  796. LoadTrusses()
  797. local idx = 0
  798. for i,v in next, BuildingParts.Truss do
  799. if idx == 360 then break end
  800. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(idx * x, idx * y, math.rad(idx) * z) * CFrame.new(0, 0, diameter))
  801. idx = idx + 1
  802. end
  803. end
  804.  
  805. function Structures.TrussRXY(player, x, y, z, diameter)
  806. LoadTrusses()
  807. local idx = 0
  808. for i,v in next, BuildingParts.Truss do
  809. if idx == 360 then break end
  810. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(idx) * x, math.rad(idx) * y, idx * z) * CFrame.new(0, 0, diameter))
  811. idx = idx + 1
  812. end
  813. end
  814.  
  815. function Structures.TrussRXZ(player, x, y, z, diameter)
  816. LoadTrusses()
  817. local idx = 0
  818. for i,v in next, BuildingParts.Truss do
  819. if idx == 360 then break end
  820. Arsenic.Remote.ReplicatePart:FireServer(i, player.Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(idx) * x, idx * y, math.rad(idx) * z) * CFrame.new(0, 0, diameter))
  821. idx = idx + 1
  822. end
  823. end
  824.  
  825. -- Cloning
  826.  
  827. function Cloning.Clone(player, city)
  828. local tc = workspace['Anchored Objects']['Towns/Cities']
  829. city = tc:FindFirstChild(city.Name)
  830.  
  831. local function findpart()
  832. for i,v in next, city:GetDescendants() do
  833. if v:IsA('BasePart') then
  834. return v
  835. end
  836. end
  837. end
  838.  
  839. Arsenic.Remote.AddClothing:FireServer('IsBuildingMaterial', city, '', '', '')
  840. repeat wait() until city:FindFirstChild('IsBuildingMaterial')
  841. Arsenic('ChangeParent', city, game:GetService('Lighting').Materials)
  842.  
  843. Arsenic.Remote.PlaceMaterial:FireServer(city.Name, player.Character.HumanoidRootPart.Position - findpart(city).Position, false)
  844.  
  845. Arsenic('ChangeParent', city, tc)
  846. Arsenic('ChangeParent', city.IsBuildingMaterial, nil)
  847. end
  848.  
  849. return Functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement