Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [ CONFIG ]
- _G.hotKey = "n"
- _G.fullRemove = false -- Enable this if you'd rather the parts be removed entirely, and not be replaceable!
- -- [ MISC ]
- _G.playerVersion = 03 -- 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!
- -- [ SCRIPT ]
- -- [ STATIC VARIABLES ]
- local players = game:GetService('Players')
- local context = game:GetService('ContextActionService')
- local lplayer = players.LocalPlayer
- local mouse = lplayer:GetMouse()
- local serverVersion = 03
- local requiredVersion = 01
- -- [ DYNAMIC VARIABLES ]
- local enabled = false
- local runScript = false
- local parts = {}
- -- [ NOTIFY FUNCTIONS ]
- local function notify(Title,Body,But1,But2,duration)
- if not But1 then
- But1 = false
- end
- if not But2 then
- But2 = false
- end
- if not duration then
- duration = 120
- end
- game.StarterGui:SetCore("SendNotification", {
- Title = Title,
- Text = Body,
- Icon = "",
- Duration = duration,
- Callback = bindableFunction,
- Button1 = But1,
- Button2 = But2
- })
- end
- -- [ VERSION CHECK ]
- if _G.playerVersion == serverVersion then
- runScript = true
- notify("Version Notification","You are running the most recent version, welcome!","Understood")
- elseif _G.playerVersion >= requiredVersion then
- runScript = true
- 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")
- else
- notify("Version Notification","Your version is too outdated, therefor the script cannot run, please update.","I will go update now")
- end
- repeat wait(1) until runScript == true
- -- [ INPUT FUNCTIONS ]
- local function mouse1Down()
- local part = mouse.Target
- if enabled then
- if not _G.fullRemove then
- if part.Name ~= "walkthrough_active" and part.Parent ~= workspace["Safety Folder"] then
- table.insert(parts,{part, part.Transparency, part.Name, part.CanCollide})
- part.Name = "walkthrough_active"
- part.CanCollide = false
- part.Transparency = 0.75
- elseif part.Parent == workspace["Safety Folder"] then
- part.Parent = game.Lighting["Safety Folder"]
- else
- for i,tpart in pairs(parts) do
- if tpart[1] == part then
- part.Name = tpart[3]
- part.CanCollide = tpart[4]
- part.Transparency = tpart[2]
- table.remove(parts,i)
- end
- end
- end
- else
- part.Parent = game.Lighting["Safety Folder"]
- end
- end
- end
- local function mouse2Down()
- local part = mouse.Target
- if enabled then
- local newPart = Instance.new("Part")
- newPart.Anchored = true
- newPart.CFrame = mouse.Hit
- newPart.Size = Vector3.new(10,1,10)
- newPart.Orientation = Vector3.new(0,0,0)
- newPart.Transparency = 0.2
- newPart.Parent = workspace["Safety Folder"]
- end
- end
- local function keypress(action,state,object)
- if state == Enum.UserInputState.Begin then
- enabled = not enabled
- if enabled then
- notify("Remove state changed","You've enabled removing & creating!",nil,nil,5)
- else
- notify("Remove state changed","You've disabled removing & creating!",nil,nil,5)
- end
- end
- end
- -- [ EVENTS ]
- mouse.Button1Down:Connect(mouse1Down)
- mouse.Button2Down:Connect(mouse2Down)
- context:BindAction("keypress", keypress, false, _G.hotKey)
- local LsafetyFolder = Instance.new("Folder")
- LsafetyFolder.Parent = game.Lighting
- LsafetyFolder.Name = "Safety Folder"
- local WsafetyFolder = Instance.new("Folder")
- WsafetyFolder.Parent = workspace
- WsafetyFolder.Name = "Safety Folder"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement