Script Editor API: Now in Beta!

Accepting scripts from a player could be pretty bad anyway…

2 Likes

I believe this is intended as ScriptDocuments are parented to ScriptEditorService.

1 Like

I think there should be methods to get/set the current cursor position, and events to listen for keyboard/mouse events in the script editor. I would like to add a shift+alt+up/down keybind to duplicate the current line, but there doesn’t seem to be any way of accomplishing this with the current API.

1 Like

YO does that mean we can have custom autocompletion? Not in the sense of a full on implemented one, but one that automatically writes text for you if you press specific keys and you can just revert the change if you don’t like it.

Also please make everything that requires a string suggest an autocompletion of only string variables and possible strings such as game:GetService(). When your cusror is in the brackets it suggests everything, except the strings I’m looking for so I have to manually put quotation marks in order to get the suggestion I want.

1 Like

This is pretty cool, but a little bit jarring. Here’s some feedback I have so far:

  • There should be some indication of whether a document change was user-performed or script-performed. Context about an undo/redo action being involved would be very helpful too.

  • I think it would be handy if we could specify a custom auto-complete pattern that the user can choose to accept, rather than automatically applying the patch with a string pattern.

  • Later down the road if possible, it’d be awesome to have some kind of Luau AST data that could be written to when making changes instead of having to make inferences about syntax (cc @zeuxcg?)

5 Likes

unless you only allow it whilst editing scripts to select snippets etc. would be risky.

Not for LocalScripts.

This is pretty cool, and I totally get it! There are a few examples of using TextEdit and loadstring for this out there.
To make this truly work is we still need to ensure usability and safety. We need to create an in game script editor that has the same features as our Studio Script Editor.
In addition, we have to ensure safety: create a sandbox where everything that is exposed to player created scripts is limited to only objects you intend to be scripted.
This is to prevent accidental or intentional damage to other players or your game. Those constraints would have to be expressed by you, the creator.
In short, this is definitely something that totally makes sense and we have been thinking about it, and it has to be done the right way.

6 Likes

Does the plugin needs “Script Injection” when using this?
Also can non Beta Users can use a Plugin with this API?

(Don’t know if this was already asked or was mentioned in the Article)

1 Like

Well for people like me this kind of thing would have the potential to turn my already super disorganized code which looks like this

game.ReplicatedStorage.openguie1.OnClientEvent:Connect(function()
	script.Parent.Parent.Enabled = true
end)










--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local this =  script
local parent = script.Parent
local par = script.Parent.pistolcostum
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local sideselection = parent.ImageLabel
local tpbar = parent.topbar
local prm = parent.primaryscrol
local snd = nil

--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local scpelist = sideselection.scopelist
local intern_super = sideselection.internasup
local extern_super = sideselection.expres
local bayoo = sideselection.bay
local extern_super = sideselection.expres
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local interspres = false
local exteralsupers = false
local baoy = false
local next_pos = 0
local isprim = false
local scopenum : number
local stock1stat,stock2stat,barrel1stat,barrel2stat,barrel3stat,barrel4stat,scopestat,mag1stat,mag2stat,mag3stat,scilencerstat =  false,false,false,false,false,false,false,false,false,false,false

--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local curentgunsel: ModuleScript 
local curentgunsel1 :{}
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦

local ambush = require(script.Folder.ambushe)


local prehistiorcrifle =require(script.Folder.prehistiorcrifle)
local prehistorcshotgun =require(script.Folder.prehistorcshotgun)










--local pistols = require(script.Folder.sec)




---local the_leafy_stick = pistols.the_leafy_stick

---local foremanspower = pistols.foremanspower








--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦bolt-action¦bolt-action¦bolt-action¦bolt-action¦bolt-action¦¦bolt-action¦bolt-action¦bolt-action¦bolt-action¦bolt-action¦¦¦¦¦¦
	local thelite = require(script.Folder.thelite)
	local thelongroad =require(script.Folder.thelongroad)
	local thritoedn =require(script.Folder.thritoedn)
	local tp38 =require(script.Folder.tp38)
	local springtime =require(script.Folder.springtime)
	local patchworker =require(script.Folder.patchworker)
	local snipersrevenge =require(script.Folder.snipersrevenge)
	local sorter =require(script.Folder.sorter)
	local dels = require(script.Folder.delisle)
	local desin =  require(script.Folder.designer)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦semi-auto¦¦¦¦¦¦
	local swedishpowerhouse =require(script.Folder.swedishpowerhouse)
	local westernfront =require(script.Folder.westernfront)
	local sovietdispg =require(script.Folder.sovietdispg)
	local thedeve =require(script.Folder.thedeve)
	local granddisp =require(script.Folder.granddisp)
	local grandpasdispline =require(script.Folder.grandpasdispline)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦lever-action¦lever-action¦lever-action¦lever-action¦lever-action¦¦lever-action¦lever-action¦lever-action¦lever-action¦lever-action¦
	local ring =require(script.Folder.ring)
	local sovietlevrage =require(script.Folder.sovietlevrage)
	local spiningblast =require(script.Folder.spiningblast)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦automatic¦automatic¦automatic¦automatic¦automatic¦automatic¦¦automatic¦automatic¦automatic¦automatic¦automatic¦automatic¦automatic¦
	local auzi = require(script.Folder.owe)
	local bar,chat = require(script.Folder.behindbars),require(script.Folder.chater)
	local cusiary = require(script.Folder.cusinarty)
	local  devspride =require(script.Folder.devspride)	
	local elderselect =require(script.Folder.elderselect)
	local finisher =require(script.Folder.finisher)
	local greatgrand =require(script.Folder.greatgrand)	
	local kars =require(script.Folder.kars)
	local madesen =require(script.Folder.madesen)
	local metalicmessager =require(script.Folder.metalicmessager)
	local mg4234 =require(script.Folder.mg4234)
	local roundhus =require(script.Folder.roundhus)
	local rpistole =require(script.Folder.rpistole)
	local serli =require(script.Folder.serli)
	local unclelewis =require(script.Folder.unclelewis)
	local para =require(script.Folder.para)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
local images =
	{
		fullydisabled = "rbxasset://textures/RoactStudioWidgets/toggle_disable_light.pngtoggle_disable_light.png";
		offhover = "rbxasset://textures/RoactStudioWidgets/toggle_off_dark.png";
		onhover = "rbxasset://textures/RoactStudioWidgets/toggle_on_disable_dark.png";
		off = "rbxasset://textures/RoactStudioWidgets/toggle_off_light.png";
		on = "rbxasset://textures/RoactStudioWidgets/toggle_on_light.png"
	}
local stock_1,stock_2, barrel_1,barrel_2,barrel_3,barrel_4,scope_1,silencer_1 = par.st1.op0,par.st2.op0,par.brl1.op0,par.brl2.op0,par.brl3.op3,par.brl4.op4,par.sc1.op0,par.silence.op0

local ambusherchildern = {script.Parent.ambusher.bayonet , script.Parent.ambusher.zf39, script.Parent.ambusher.handle  }
local behindbarschildern = {script.Parent.behindbars.handle , script.Parent.behindbars.bayonet , script.Parent.behindbars["Fallschirmjägergewehr 42 scope"] }
local chatchildern = {script.Parent.chat.handle  }
local cusionartychildern = {script.Parent.cusionarty.handle  }
local delislechildern = {script.Parent.delisle["Fallschirmjägergewehr 42 scope"], script.Parent.delisle.handle  }
local designerchildern = {script.Parent.designer.handle , script.Parent.designer.bayonet , script.Parent.designer["pu scope"], script.Parent.designer["M1903A3 scope"], script.Parent.designer["Fallschirmjägergewehr 42 scope"], script.Parent.designer.zag, script.Parent.designer.inergral , script.Parent.designer.extenral }
local develchildern = {script.Parent.devel.handle  }
local devspridechildern = {script.Parent.devspride.handle  }
local elderchildern = {script.Parent.elder["Fallschirmjägergewehr 42 scope"], script.Parent.elder.handle , script.Parent.elder.extenral  }
local finisherchildern = {script.Parent.finisher.extenral , script.Parent.finisher.inergral , script.Parent.finisher.handle  }
local granddispchildern = {script.Parent.granddisp["Fallschirmjägergewehr 42 scope"], script.Parent.granddisp.extenral , script.Parent.granddisp.handle , script.Parent.granddisp.bayonet  }
local grandpasdisiplinechildern = {script.Parent["grandpas disipline"]["Fallschirmjägergewehr 42 scope"], script.Parent["grandpas disipline"].handle }
local greatgrandchildern = {script.Parent.greatgrand.handle  }
local k98childern = {script.Parent.k98["M1903A3 scope"], script.Parent.k98.handle , script.Parent.k98.extenral , script.Parent.k98.inergral , script.Parent.k98.bayonet , script.Parent.k98.fg42sco, script.Parent.k98["pu scope"] }
local karschildern = {script.Parent.kars.handle , script.Parent.kars.inergral  }
local longroadchildern = {script.Parent.longroad.handle , script.Parent.longroad.bayonet , script.Parent.longroad["pu scope"] }
local madesenchildern = {script.Parent.madesen.handle  }
local metalicmessagerchildern = {script.Parent["metalic messager"].extenral , script.Parent["metalic messager"].handle }
local mg4234childern = {script.Parent["mg42/34"].handle , script.Parent["mg42/34"].zag }
local owenchildern = {script.Parent.owen.handle , script.Parent.owen.inergral , script.Parent.owen.extenral  }
local parachildern = {script.Parent.para.handle , script.Parent.para.inergral , script.Parent.para.extenral , script.Parent.para["pu scope"], script.Parent.para["M1903A3 scope"], script.Parent.para["Fallschirmjägergewehr 42 scope"], script.Parent.para.zag, script.Parent.para.fallirons, script.Parent.para.bayonet  }
local patchworkerchildern = {script.Parent.patchworker.bayonet , script.Parent.patchworker["M1903A3 scope"], script.Parent.patchworker.handle  }
local prehistiorcriflechildern = {script.Parent.prehistiorcrifle["M1903A3 scope"], script.Parent.prehistiorcrifle.handle  }
local prehistorcshotgunchildern = {script.Parent.prehistorcshotgun["M1903A3 scope"], script.Parent.prehistorcshotgun.handle  }
local ringchildern = {script.Parent.ring.handle , script.Parent.ring.bayonet  }
local roundhuschildern = {script.Parent.roundhus.handle  }
local rpistolechildern = {script.Parent.rpistole.extenral , script.Parent.rpistole.handle  }
local serlichildern = {script.Parent.serli.handle  }
local sorterchildern = {script.Parent.sorter.bayonet , script.Parent.sorter.handle , script.Parent.sorter.zf39 }
local sovietdispgchildern = {script.Parent.sovietdispg["pu scope"], script.Parent.sovietdispg.handle , script.Parent.sovietdispg.inergral , script.Parent.sovietdispg.extenral , script.Parent.sovietdispg.bayonet  }
local sovietlevragechildern = {script.Parent.sovietlevrage.bayonet , script.Parent.sovietlevrage.handle  }
local springchildern = {script.Parent.spring.handle , script.Parent.spring["M1903A3 scope"], script.Parent.spring.bayonet  }
local swedishpowerhousechildern = {script.Parent["swedish powerhouse"].zf39, script.Parent["swedish powerhouse"].handle  }
local theelitechildern = {script.Parent.theelite.extenral , script.Parent.theelite["M1903A3 scope"], script.Parent.theelite.handle , script.Parent.theelite.inergral  }
local tp38childern = {script.Parent.tp38.handle , script.Parent.tp38.bayonet , script.Parent.tp38["Fallschirmjägergewehr 42 scope"] }
local trftearfchildern = {script.Parent.trftearf.handle , script.Parent.trftearf.bayonet , script.Parent.trftearf.zf39 }
local unclelewischildern = {script.Parent.unclelewis.handle  }
local westernfrontchildern = {script.Parent.westernfront.handle , script.Parent.westernfront.bayonet  }
local winchester1887childern = {script.Parent.winchester1887.handle  }
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
function fate_of_toggle_forest (selected:ImageButton,selection:{},status:boolean)
if not status then
selected.HoverImage = images.fullydisabled
selected.PressedImage = images.fullydisabled
selected.Image = images.fullydisabled
end



local function toggle (selected:{button:ImageButton, status:boolean,status_allowed:boolean},selection:{buttons:{},bools:{}}, selectedgunobjectfilething)
if status_allowed then
	if selected.status == false then







	end
else 
return
end

	


	
end

function  buttons_a (gun:Model,wantedtype,wanted_bool)
	print(gun)
	if gun then
	if  gun.base:FindFirstChild(wantedtype) ~= nil then
		
			if wanted_bool == false then
 gun.base:FindFirstChild(wantedtype).Transparency = 0
				return true
		elseif wanted_bool  then
			gun.base:FindFirstChild(wantedtype).Transparency = 1
			return false
		
			end						

end

	
	end
	
end
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
function gamepasment(objectlock:ImageLabel,uid:number,gamepasid:number,gun)
	if objectlock.Visible then
		--	?---------------------------------------------------------------------------------------------------------------------?

		if objectlock.Image == "rbxassetid://" .. tostring(10067267871) then -- developer
			local rank = game.Players:GetPlayerByUserId(uid):GetRankInGroup(5445311)
			if rank == 250 or rank == 254 or rank == 255 then
				objectlock.Visible = false	

				print(gun.base.handle.Transparency)

				gun.base.handle.Transparency = 0


				return			
			end
			--	?---------------------------------------------------------------------------------------------------------------------?
		elseif  objectlock.Image == "rbxassetid://" .. tostring(10067267363) then -- personal
			print(gun.base.name)
	


			
			--	?---------------------------------------------------------------------------------------------------------------------?

		elseif objectlock.Image == "rbxassetid://" .. tostring(10067266986)  then -- gamepass	
			objectlock.Visible = false	

			print(gun.base.handle.Transparency)

			gun.base.handle.Transparency = 0


			return			
		end





	end


end
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
function hide_all(wantedgun)
	for i,v in pairs(ambusherchildern)do 			v.Transparency = 1 end
	for i,v in pairs(behindbarschildern)do 			v.Transparency = 1 end
	for i,v in pairs(chatchildern)do 			v.Transparency = 1 end
	for i,v in pairs(cusionartychildern)do 			v.Transparency = 1 end
	for i,v in pairs(delislechildern)do 			v.Transparency = 1 end
	for i,v in pairs(designerchildern)do 			v.Transparency = 1 end
	for i,v in pairs(develchildern)do 			v.Transparency = 1 end
	for i,v in pairs(devspridechildern)do 			v.Transparency = 1 end
	for i,v in pairs(elderchildern)do 			v.Transparency = 1 end
	for i,v in pairs(finisherchildern)do 			v.Transparency = 1 end
	for i,v in pairs(granddispchildern)do 			v.Transparency = 1 end
	for i,v in pairs(grandpasdisiplinechildern)do 			v.Transparency = 1 end
	for i,v in pairs(greatgrandchildern)do 			v.Transparency = 1 end
	for i,v in pairs(k98childern)do 			v.Transparency = 1 end
	for i,v in pairs(karschildern)do 			v.Transparency = 1 end
	for i,v in pairs(longroadchildern)do 			v.Transparency = 1 end
	for i,v in pairs(madesenchildern)do 			v.Transparency = 1 end
	for i,v in pairs(metalicmessagerchildern)do 			v.Transparency = 1 end
	for i,v in pairs(mg4234childern)do 			v.Transparency = 1 end
	for i,v in pairs(owenchildern)do 			v.Transparency = 1 end
	for i,v in pairs(parachildern)do 			v.Transparency = 1 end
	for i,v in pairs(patchworkerchildern)do 			v.Transparency = 1 end
	for i,v in pairs(prehistiorcriflechildern)do 			v.Transparency = 1 end
	for i,v in pairs(prehistorcshotgunchildern)do 			v.Transparency = 1 end
	for i,v in pairs(ringchildern)do 			v.Transparency = 1 end
	for i,v in pairs(roundhuschildern)do 			v.Transparency = 1 end
	for i,v in pairs(rpistolechildern)do 			v.Transparency = 1 end
	for i,v in pairs(serlichildern)do 			v.Transparency = 1 end
	for i,v in pairs(sorterchildern)do 			v.Transparency = 1 end
	for i,v in pairs(sovietdispgchildern)do 			v.Transparency = 1 end
	for i,v in pairs(sovietlevragechildern)do 			v.Transparency = 1 end
	for i,v in pairs(springchildern)do 			v.Transparency = 1 end
	for i,v in pairs(swedishpowerhousechildern)do 			v.Transparency = 1 end
	for i,v in pairs(theelitechildern)do 			v.Transparency = 1 end
	for i,v in pairs(tp38childern)do 			v.Transparency = 1 end
	for i,v in pairs(trftearfchildern)do 			v.Transparency = 1 end
	for i,v in pairs(unclelewischildern)do 			v.Transparency = 1 end
	for i,v in pairs(westernfrontchildern)do 			v.Transparency = 1 end
	for i,v in pairs(winchester1887childern)do 			v.Transparency = 1 end
	for i,v in pairs(winchester1887childern)do 			v.Transparency = 1 end
	interspres = false
	exteralsupers = false
	baoy = false
	next_pos = 0
	wait(.1)
	curentgunsel = wantedgun
	print(wantedgun)
	wantedgun.base.handle.Transparency = 0
	return
	
	
	



	
	
end
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
script.Parent.topbar.prim.MouseButton1Click:Connect(function()

	if not isprim then

		script.Parent.primaryscrol.Visible = true
		isprim = true
		return
	elseif isprim then
		script.Parent.primaryscrol.Visible = false
		isprim = false
		return


	end



end)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
extern_super.n.MouseButton1Click:Connect(function ()

	print(exteralsupers)

	if exteralsupers == nil then
	exteralsupers = false
		return
	else
		exteralsupers =  buttons_a(curentgunsel,"extenral",exteralsupers)
	end
end)
intern_super.n.MouseButton1Click:Connect(function ()
	print(interspres)

	if interspres == nil then
		interspres = false
		return
	else
		interspres =  buttons_a(curentgunsel,"inergral",interspres)
	end
end)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
scpelist.nex.MouseButton1Click:Connect(function()
	if	curentgunsel.bayonet == true then
		bayoo.Visible = true
	else 
		bayoo.Visible = false
	end
	if	curentgunsel["integral suppressor"] == true then
		intern_super.Visible = true
	else 
		intern_super.Visible = false
	end
	if	curentgunsel["external suppressor"] == true then
		extern_super.Visible = true
	else 
		extern_super.Visible = false
	end

	if	curentgunsel.ZF39 == true then
		scpelist.ZF39   .Visible = true
	else 
		scpelist.ZF39   .Visible = false
	end
	if	curentgunsel["pu scope"] == true then
		scpelist.puscope   .Visible = true
	else 
		scpelist.puscope   .Visible = false		
	end
	if	curentgunsel["M1903A3 scope"] == true then
		scpelist.m1903a   .Visible = true
	else 
		scpelist.m1903a   .Visible = false		
	end
	if	curentgunsel["no sights"] == true then
		scpelist.nsigh   .Visible = true
	else 
		scpelist.nsigh   .Visible = false	
	end
	if	curentgunsel["Fallschirmjägergewehr 42 iron sights"] == true then
		scpelist.fg42sighs   .Visible = true
	else 
		scpelist.fg42sighs   .Visible = false	
	end
	if	curentgunsel["Fallschirmjägergewehr 42 scope"] == true then
		scpelist.fg42Spe   .Visible = true
	else 
		scpelist.fg42Spe   .Visible = false			
	end
	if	curentgunsel["Zielgerät 1229"] == true then
		scpelist["Zielgerät"]   .Visible = true
	else 
		scpelist["Zielgerät"]   .Visible = false	
	end
	if	curentgunsel["default sights"] == true then
		scpelist.dftsigh .Visible = true
	else 
		scpelist.dftsigh  .Visible = false	
	end


	-----------------------------------------------------
	if next_pos == 	0	 then
		next_pos = 	1	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	0	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	1	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	5	,0);

		return		
	elseif next_pos == 	1	 then
		next_pos = 	2	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	0	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	4	,0);

		return		
	elseif next_pos == 	2	 then
		next_pos = 	3	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	6	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	3	,0);

		return		
	elseif next_pos == 	3	 then
		next_pos = 	4	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	5	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	6	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	2	,0);

		return		
	elseif next_pos == 	4	 then
		next_pos = 	5	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	4	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	5	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	1	,0);

		return		
	elseif next_pos == 	5	 then
		next_pos = 	6	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	3	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	4	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	0	,0);

		return		
	elseif next_pos == 	6	 then
		next_pos = 	7	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	2	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	3	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	-1	,0);

		return		
	elseif next_pos == 	7	 then
		next_pos = 	0	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	1	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	2	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	6	,0);
	end























end)
scpelist.pev.MouseButton1Click:Connect(function()
	
	
	if	curentgunsel.bayonet == true then
		bayoo.Visible = true
	else 
		bayoo.Visible = false
	end
	if	curentgunsel["integral suppressor"] == true then
		intern_super.Visible = true
	else 
		intern_super.Visible = false
	end
	if	curentgunsel["external suppressor"] == true then
		extern_super.Visible = true
	else 
		extern_super.Visible = false
	end

	if	curentgunsel.ZF39 == true then
		scpelist.ZF39   .Visible = true
	else 
		scpelist.ZF39   .Visible = false
	end
	if	curentgunsel["pu scope"] == true then
		scpelist.puscope   .Visible = true
	else 
		scpelist.puscope   .Visible = false		
	end
	if	curentgunsel["M1903A3 scope"] == true then
		scpelist.m1903a   .Visible = true
	else 
		scpelist.m1903a   .Visible = false		
	end
	if	curentgunsel["no sights"] == true then
		scpelist.nsigh   .Visible = true
	else 
		scpelist.nsigh   .Visible = false	
	end
	if	curentgunsel["Fallschirmjägergewehr 42 iron sights"] == true then
		scpelist.fg42sighs   .Visible = true
	else 
		scpelist.fg42sighs   .Visible = false	
	end
	if	curentgunsel["Fallschirmjägergewehr 42 scope"] == true then
		scpelist.fg42Spe   .Visible = true
	else 
		scpelist.fg42Spe   .Visible = false			
	end
	if	curentgunsel["Zielgerät 1229"] == true then
		scpelist["Zielgerät"]   .Visible = true
	else 
		scpelist["Zielgerät"]   .Visible = false	
	end
	if	curentgunsel["default sights"] == true then
		scpelist.dftsigh .Visible = true
	else 
		scpelist.dftsigh  .Visible = false	
	end

	
	----------------------------
	if next_pos == 	0	 then
		next_pos = 	7	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	0	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	1	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	5	,0);

		return		
	elseif next_pos == 	1	 then
		next_pos = 	0	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	0	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	4	,0);

		return		
	elseif next_pos == 	2	 then
		next_pos = 	1	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	6	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	3	,0);

		return		
	elseif next_pos == 	3	 then
		next_pos = 	2	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	5	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	6	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	2	,0);

		return		
	elseif next_pos == 	4	 then
		next_pos = 	3	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	4	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	5	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	1	,0);

		return		
	elseif next_pos == 	5	 then
		next_pos = 	4	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	2	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	3	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	4	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	0	,0);

		return		
	elseif next_pos == 	6	 then
		next_pos = 	5	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	1	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	2	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	3	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	6	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	-1	,0);

		return		
	elseif next_pos == 	7	 then
		next_pos = 	6	
		scpelist.nsigh.Position = UDim2.new(0.08,0,	-1	,0);
		scpelist.dftsigh.Position = UDim2.new(0.08,0,	0	,0);
		scpelist.puscope.Position = UDim2.new(0.08,0,	1	,0);
		scpelist["Zielgerät"].Position = UDim2.new(0.08,0,	2	,0);
		scpelist.m1903a.Position = UDim2.new(0.08,0,	3	,0);
		scpelist.ZF39.Position = UDim2.new(0.08,0,	4	,0);
		scpelist.fg42sighs.Position = UDim2.new(0.08,0,	5	,0);
		scpelist.fg42Spe.Position = UDim2.new(0.08,0,	6	,0);
	end
end)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
scpelist.ZF39.MouseButton1Click:Connect(function ()
	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 0
		scopenum = 4
		
	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end


end)
scpelist.m1903a .MouseButton1Click:Connect(function ()
	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 0
		scopenum = 3
	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end
end)
scpelist.nsigh .MouseButton1Click:Connect(function ()
	scopenum = 0

	if 	curentgunsel.base.zf39 ~= nil then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 	curentgunsel.base.zag ~= nil then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if 	curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base["pu scope"]~= nil  then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end
end)
scpelist.dftsigh .MouseButton1Click:Connect(function ()
	scopenum = 0
	if 	curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 	curentgunsel.base.zag ~= nil then
		curentgunsel.base.zag.Transparency = 1
	
		
	end
	if	curentgunsel.base["M1903A3 scope"]~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if 	curentgunsel.base["Fallschirmjägergewehr 42 scope"]~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil  ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end

end)
scpelist.fg42Spe .MouseButton1Click:Connect(function ()
	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 0
		scopenum = 6
	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end

end)
scpelist.puscope .MouseButton1Click:Connect(function ()

	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 0
		scopenum = 1
	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end

end)
scpelist.fg42sighs .MouseButton1Click:Connect(function ()
	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 1

	end
	if	curentgunsel.base:FindFirstChild("M1903A3 scope") ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 0
		scopenum = 5
	end

end)
scpelist["Zielgerät"] .MouseButton1Click:Connect(function ()
	if 		curentgunsel.base:FindFirstChild("zf39") ~= nil  then
		curentgunsel.base.zf39.Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("zag") ~= nil  then
		curentgunsel.base.zag.Transparency = 0
		scopenum = 2
	end
	if	curentgunsel.base["M1903A3 scope"] ~= nil then
		curentgunsel.base["M1903A3 scope"] .Transparency = 1

	end
	if curentgunsel.base:FindFirstChild("Fallschirmjägergewehr 42 scope") ~= nil then
		curentgunsel.base["Fallschirmjägergewehr 42 scope"].Transparency = 1

	end
	if 		curentgunsel.base:FindFirstChild("pu scope") ~= nil then
		curentgunsel.base["pu scope"] .Transparency = 1

	end

	if curentgunsel.base:FindFirstChild("fallirons") ~= nil then
		curentgunsel.base.fallirons.Transparency = 1

	end
end)
--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
stock_1.MouseButton1Click:Connect(function ()

	stock1stat,stock2stat = toggle(	{stock_1,stock1stat},{stock_2},{stock2stat}) 

end)
stock_2.MouseButton1Click:Connect(function ()
	stock2stat,stock1stat = toggle(	{stock_2,stock2stat},{stock_1},{stock1stat})




end)
scope_1.MouseButton1Click:Connect(function ()
	scopestat = toggle(	{scope_1,scopestat},{},{},curentgunsel1) 

end)


barrel_1.MouseButton1Click:Connect(function ()
	barrel1stat,barrel2stat = toggle({barrel_1,barrel1stat},{barrel_2},{barrel2stat})
	barrel1stat,barrel3stat = toggle({barrel_1,barrel1stat},{barrel_3},{barrel3stat})
	barrel1stat,barrel4stat = toggle({barrel_1,barrel1stat},{barrel_4},{barrel4stat})
end)

barrel_2.MouseButton1Click:Connect(function 
()
	if not barrel2stat == true and barrel3stat or barrel1stat or barrel4stat then	
	barrel2stat,barrel3stat = toggle({barrel_2,barrel2stat},{barrel_3},{barrel3stat})
	barrel2stat,barrel4stat = toggle({barrel_2,barrel2stat},{barrel_4},{barrel4stat})		
	barrel2stat,barrel1stat = toggle({barrel_2,barrel2stat},{barrel_1},{barrel1stat})
	elseif barrel2stat and not barrel1stat and not barrel3stat and not barrel4stat then
		barrel2stat,barrel3stat = toggle({barrel_2,barrel2stat},{barrel_3},{barrel3stat})
		barrel2stat,barrel4stat = toggle({barrel_2,barrel2stat},{barrel_4},{barrel4stat})		
		barrel2stat,barrel1stat = toggle({barrel_2,barrel2stat},{barrel_1},{barrel1stat})	
	end
	
	
end)
barrel_3.MouseButton1Click:Connect(function ()
	if not barrel3stat == true and barrel2stat or barrel1stat or barrel4stat then
	
	barrel3stat,barrel4stat = toggle({barrel_3,barrel3stat},{barrel_4},{barrel4stat})		
	barrel3stat,barrel1stat = toggle({barrel_3,barrel3stat},{barrel_1},{barrel1stat})
	barrel3stat,barrel2stat = toggle({barrel_3,barrel3stat},{barrel_2},{barrel2stat})
	elseif barrel3stat and not barrel1stat and not barrel2stat and not barrel4stat then
		barrel3stat,barrel4stat = toggle({barrel_3,barrel3stat},{barrel_4},{barrel4stat})		
		barrel3stat,barrel1stat = toggle({barrel_3,barrel3stat},{barrel_1},{barrel1stat})
		barrel3stat,barrel2stat = toggle({barrel_3,barrel3stat},{barrel_2},{barrel2stat})		
	end
		
		
		end)
			barrel_4.MouseButton1Click:Connect(function ()
	barrel4stat,barrel1stat = toggle({barrel_4,barrel4stat},{barrel_1},{barrel1stat})
	barrel4stat,barrel2stat = toggle({barrel_4,barrel4stat},{barrel_2},{barrel2stat})		

	barrel4stat,barrel3stat = toggle({barrel_4,barrel4stat},{barrel_3},{barrel3stat})

			end)
			silencer_1.MouseButton1Click:Connect(function ()
	scilencerstat = toggle(	{silencer_1,scilencerstat},{},{}) 

			end)




--	¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
bayoo.y.MouseButton1Click:Connect(function ()
	print(exteralsupers)

	if baoy == nil then
	baoy = false
		return
	else
		baoy = 	 buttons_a(curentgunsel,"bayonet",baoy)
	


	end
end)


local commenwethpass = 9189544;

prm.auzzie["select/equip"].MouseButton1Click:Connect(function ()
	local thisvar = 
		
		{
			[1] = prm.auzzie.ImageLabel,
			[2] = game.Players.LocalPlayer.UserId,
			[3] = 9189544
		
		}
	


	if curentgunsel ~= nil then
		hide_all(auzi)

	else
	
 	gamepasment(thisvar[1],thisvar[2],thisvar[3],auzi)
	curentgunsel = 	 auzi
end	
	
		
		
		
end)



prm.ambu["select/equip"].MouseButton1Click:Connect(function ()
	local thisvar = 

		{
			[1] = prm.ambu.ImageLabel,
			[2] = game.Players.LocalPlayer.UserId,
			[3] = 9189544
		
		}
print(curentgunsel)
	
	
	if curentgunsel ~= nil then
		hide_all(ambush)

	else
		gamepasment(thisvar[1],thisvar[2],thisvar[3],ambush)
	curentgunsel = 	 ambush
end
	
	
end)
prm.bhb["select/equip"].MouseButton1Click:Connect(function ()
	local thisvar = 

		{
			[1] = prm.bhb.ImageLabel,
			[2] = game.Players.LocalPlayer.UserId,
			[3] = 9189544

		}
	print(curentgunsel)


	if curentgunsel ~= nil then
		hide_all(bar)

	else
		gamepasment(thisvar[1],thisvar[2],thisvar[3],bar)
		curentgunsel = 	 bar
	end


end)

function tinker (gun_name:string)
	local tinkertrigger = ""
	local primarygunslist = {"ambusher",
		"auziliner",
		"behind_bars",
		"chater box",
		"cusion arty",
		"developer's pride",
		"the developement",
		"deadeye samurai",
		"elders_select",
		"the elite",
		"grand display",
		"finisher",
		"great grandpa tommy",
		"grandpa's disipline",
		"grand soviet display",
		"kar's machine pistole",
		"the lawn mower",
		"marlin ring",
		"machine gun madie",
		"metalic messager",
		"patchwork",
		"prehistoric rifle",
		"spinning blast",
		"russian leverage",
		"paratrooper's pal",
		"the roundhouse",
		"prehistoric shotgun",
		"sniper's revenge",
		"the sorter",
		"swedish power house",
		"spring time",
		"serling engine",
		"the designer",
		"the quiet one",
		"the long road",
		"the rifle to end all rifles",
		"the rapid pistol",
		"uncle lewis",
		"western front"}	
	
	
	if game.Players.LocalPlayer.Backpack:FindFirstChild(gun_name) then
		print("is in backpack!")
		
		local bey = false
		if baoy then 
			bey = true
		end
	
		
		game.ReplicatedStorage.add_attachments:FireServer(gun_name,bey,scopenum,interspres,exteralsupers)
		warn("set up a data store realthar you fool! -- from realthar . as a reminder to self")
		--datastore stuff here
		--datastore stuff here
		--datastore stuff here
		--datastore stuff here
		--datastore stuff here
		
		
	script.Parent.Parent.Enabled = false
		
		
		
		
		
		
	elseif not game.Players.LocalPlayer.Backpack:FindFirstChild(gun_name) then
		warn("weapon not found!: error 424")
		for i,v in pairs(primarygunslist) do
			if game.Players.LocalPlayer.Backpack:FindFirstChild(v) ~= nil then
				print(v)
			tinkertrigger = v
				continue
			end
		end		
		
		if tinkertrigger ~= "" then
			warn("you already have a gun of that class")
			game.Players.LocalPlayer.Backpack:FindFirstChild(tinkertrigger):Destroy()
			wait(1)
			-- isert new gun
		end
		
		
		
		
		
	end
end


 

tpbar.close.MouseButton1Click:Connect(function ()
	if curentgunsel == ambush then
		

	tinker("ambusher")
		return
	elseif curentgunsel == auzi  then
		tinker("auziliner")
	elseif curentgunsel == bar  then
		tinker("behind_bars")

	
		end
		
end)

which tends to be more confusing for me to find problems and certain stuff, bc have to look thru the rest to find it. but by this set of features, it has the potential to make my super messy and disorganized code a whole bunch worse.

– side note
comaring the way you can see code in roblox studio vs making your code in visual studio. well the diffrence in what i can see and not of my code on visual studio is so enormous to the point it makes my brain feel like a melted bowl of ice cream.

4 Likes

Why does my script stop here?
image
image

The doc is a module script, I already tried converting it to a normal script but that doesnt work either.

EDIT: This doesnt seem to work in modules, but does work in a normal script? Kinda odd

are you testing it as a plugin or normal script?

Hello, I love the feature but I wish it could access closed scripts. I would love to make a plugin that lets you search through any text in all the scripts in the project. This is similar to a feature vscode has. Is there any way to do this, or are there plans to add this? I know this could be abused with writing to unopened scripts without the developers knowing, but perhaps a little notification appearing and telling the devs what scripts were changed would be good? I look forward to being able to make some sort of global text finder plugin. Thanks :slight_smile:

1 Like

Hi, since there is already a widget for searching (and replacing) text in scrips, will your plugin have more features?

While it would be easier to make such a plugin with these new APIs, it is still possible to make it using current methods. I’ve made a plugin replacement for the FindAll/ReplaceAll widget, which allows you to blacklist/whitelist paths (aside from other features original one has), since it was requested by multiple people, but never addressed by Roblox. Fixed pattern matching, since it was not working correctly in the Roblox’s widget(?) I’ll probably add more features in the future.

Also, isn’t there a permission system, where plugins aren’t allowed to insert/modify scripts without user allowing them to?

1 Like

Hello. My idea for a searcher is to be able to be search in every script in the project all at once. Yes I’m aware that you can currently search, but that’s only 1 script at a time. If you forgot which script you put some code you could use this search and it will look through all the scripts and find the script as well as the line number or something like that. It would also say let you find out how all your scripts are linked if you search for requires of that script. Not sure if this is exactly what you made, and if it is then my bad. Id love to try your plugin as I have wanted this functionality for a while!

Also I’m not sure if there is a proper permissions system yet

I second this suggestion. I know there are plugins out there to parse out documentation from a script, but they don’t add much value because you have to locate the function you’re curious about in a list, and it may be hard to find. If I could keep the documentation synced with the script editor, that would be clutch.

I think I came across a visual bug. All I did was use the new API to edit multiple lines to update a config file for when my plugin gets updated with more configs. I assume it has something to do with the commenting too, but it only fixes if you go in manually and modify the line manually and then it fixes.

image

1 Like

Is is possible to make auto complete for a Script Editor plugin with this? If so, how would I got about it?

2 Likes

Yeah, especially Tab for an auto-correct plugin.


They can also add a function to add something to the auto-suggestions popup.

2 Likes

We can make it show suggestions? How?? I have been looking for this for a bit.