Advertisement
ehsaan555_a

Untitled

Apr 2nd, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. -- [ CONFIG ]
  2. _G.hotKey = "N"
  3.  
  4. -- [ MISC ]
  5. _G.playerVersion = 02 -- DO NOT CHANGE THIS, THIS IS SO THE SCRIPT CAN CHECK WHAT VERSION YOU'RE RUNNING AND NOTIFY YOU IF NEW CONFIG OPTIONS ARE REQUIRED!
  6.  
  7. -- [ STATIC VARIABLES ]
  8. local players = game:GetService('Players')
  9. local context = game:GetService('ContextActionService')
  10. local lplayer = players.LocalPlayer
  11. local mouse = lplayer:GetMouse()
  12. local serverVersion = 02
  13. local requiredVersion = 01
  14.  
  15. -- [ DYNAMIC VARIABLES ]
  16. local enabled = false
  17. local runScript = false
  18. local parts = {}
  19.  
  20. -- [ NOTIFY FUNCTIONS ]
  21. local function notify(Title,Body,But1,But2,duration)
  22. if not But1 then
  23. But1 = false
  24. end
  25. if not But2 then
  26. But2 = false
  27. end
  28. if not duration then
  29. duration = 120
  30. end
  31. game.StarterGui:SetCore("SendNotification", {
  32. Title = Title,
  33. Text = Body,
  34. Icon = "",
  35. Duration = duration,
  36. Callback = bindableFunction,
  37. Button1 = But1,
  38. Button2 = But2
  39. })
  40. end
  41.  
  42. -- [ VERSION CHECK ]
  43. if _G.playerVersion == serverVersion then
  44. runScript = true
  45. notify("Version Notification","You are running the most recent version, welcome!","Understood")
  46. elseif _G.playerVersion >= requiredVersion then
  47. runScript = true
  48. notify("Version Notification","WARNING: You are running an outdated version, grab an updated version on the original thread else yours may break soon.","I will update soon")
  49. else
  50. notify("Version Notification","Your version is too outdated, therefor the script cannot run, please update.","I will go update now")
  51. end
  52.  
  53. repeat wait(1) until runScript == true
  54.  
  55. -- [ INPUT FUNCTIONS ]
  56. local function mouse1Down()
  57. local part = mouse.Target
  58. if enabled then
  59. if part.Name ~= "walkthrough_active" and part.Parent ~= workspace["Safety Folder"] then
  60. table.insert(parts,{part, part.Transparency, part.Name, part.CanCollide})
  61. part.Name = "walkthrough_active"
  62. part.CanCollide = false
  63. part.Transparency = 0.75
  64. elseif part.Parent == workspace["Safety Folder"] then
  65. part.Parent = game.Lighting["Safety Folder"]
  66. else
  67. for i,tpart in pairs(parts) do
  68. if tpart[1] == part then
  69. part.Name = tpart[3]
  70. part.CanCollide = tpart[4]
  71. part.Transparency = tpart[2]
  72. table.remove(parts,i)
  73. end
  74. end
  75. end
  76. end
  77. end
  78.  
  79. local function mouse2Down()
  80. local part = mouse.Target
  81. if enabled then
  82. local newPart = Instance.new("Part")
  83. newPart.Anchored = true
  84. newPart.CFrame = mouse.Hit
  85. newPart.Size = Vector3.new(10,1,10)
  86. newPart.Orientation = Vector3.new(0,0,0)
  87. newPart.Transparency = 0.2
  88. newPart.Parent = workspace["Safety Folder"]
  89. end
  90. end
  91.  
  92. local function keypress(action,state,object)
  93. if state == Enum.UserInputState.Begin then
  94. enabled = not enabled
  95. if enabled then
  96. notify("Remove state changed","You've enabled removing & creating!",nil,nil,5)
  97. else
  98. notify("Remove state changed","You've disabled removing & creating!",nil,nil,5)
  99. end
  100. end
  101. end
  102.  
  103. -- [ EVENTS ]
  104. mouse.Button1Down:Connect(mouse1Down)
  105. mouse.Button2Down:Connect(mouse2Down)
  106. context:BindAction("keypress", keypress, false, _G.hotKey)
  107.  
  108. local LsafetyFolder = Instance.new("Folder")
  109. LsafetyFolder.Parent = game.Lighting
  110. LsafetyFolder.Name = "Safety Folder"
  111.  
  112. local WsafetyFolder = Instance.new("Folder")
  113. WsafetyFolder.Parent = workspace
  114. WsafetyFolder.Name = "Safety Folder"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement