Pinkstack/roblox-luau-corpus-text huggingface dataset:
------------------------------------------------------------------------
-- writes an instruction of type ABC
-- * calls luaK:code()
------------------------------------------------------------------------


function luaK:codeABC(fs, o, a, b, c)
  assert(luaP:getOpMode(o) == luaP.OpMode.iABC)
  assert(luaP:getBMode(o) ~= luaP.OpArgMask.OpArgN or b == 0)
  assert(luaP:getCMode(o) ~= luaP.OpArgMask.OpArgN or c == 0)
  return self:code(fs, luaP:CREATE_ABC(o, a, b, c), fs.ls.lastline)
end
-- Looks for a folder within workspace.Terrain that contains elements to visualize casts.


local function GetFastCastVisualizationContainer(): Instance
	local fcVisualizationObjects = workspace.Terrain:FindFirstChild(FC_VIS_OBJ_NAME)
	if fcVisualizationObjects ~= nil then
		return fcVisualizationObjects
	end
	
	fcVisualizationObjects = Instance.new("Folder")
	fcVisualizationObjects.Name = FC_VIS_OBJ_NAME
	fcVisualizationObjects.Archivable = false -- TODO: Keep this as-is? You can't copy/paste it if this is false. I have it false so that it doesn't linger in studio if you save with the debug data in there.
	fcVisualizationObjects.Parent = workspace.Terrain
	return fcVisualizationObjects
end
------------------------------------------------------------------------
-- parse a repeat-until control structure, body parsed by chunk()
-- * used in statements()
------------------------------------------------------------------------


function luaY:repeatstat(ls, line)
  -- repeatstat -> REPEAT block UNTIL cond
  local fs = ls.fs
  local repeat_init = luaK:getlabel(fs)
  local bl1, bl2 = {}, {}  -- BlockCnt
  self:enterblock(fs, bl1, true)  -- loop block
  self:enterblock(fs, bl2, false)  -- scope block
  luaX:next(ls)  -- skip REPEAT
  self:chunk(ls)
  self:check_match(ls, "TK_UNTIL", "TK_REPEAT", line)
  local condexit = self:cond(ls)  -- read condition (inside scope block)
  if not bl2.upval then  -- no upvalues?
    self:leaveblock(fs)  -- finish scope
    luaK:patchlist(ls.fs, condexit, repeat_init)  -- close the loop
  else  -- complete semantics when there are upvalues
    self:breakstat(ls)  -- if condition then break
    luaK:patchtohere(ls.fs, condexit)  -- else...
    self:leaveblock(fs)  -- finish scope...
    luaK:patchlist(ls.fs, luaK:jump(fs), repeat_init)  -- and repeat
  end
  self:leaveblock(fs)  -- finish loop
end
--red 11


if k == "r" and ibo.Value==true then
	bin.Blade.BrickColor = BrickColor.new("Really red")
	bin.Blade2.BrickColor = BrickColor.new("Institutional white")
	bin.Blade.White.Enabled=false colorbin.white.Value = false
	bin.Blade.Blue.Enabled=false colorbin.blue.Value = false
	bin.Blade.Green.Enabled=false colorbin.green.Value = false
	bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
	bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
	bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
	bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
	bin.Blade.Red.Enabled=true colorbin.red.Value = true
	bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
	bin.Blade.Black.Enabled=false colorbin.black.Value = false
	bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
	bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false
	bin.Blade.Cyan.Enabled=false colorbin.cyan.Value = false
    end
--[[
	Index into `Event` to get a prop key for attaching to an event on a Roblox
	Instance.

	Example:

		Roact.createElement("TextButton", {
			Text = "Hello, world!",

			[Roact.Event.MouseButton1Click] = function(rbx)
				print("Clicked", rbx)
			end
		})
]]



local Type = require(script.Parent.Parent.Type)

local Event = {}

local eventMetatable = {
	__tostring = function(self)
		return ("RoactHostEvent(%s)"):format(self.name)
	end,
}

setmetatable(Event, {
	__index = function(self, eventName)
		local event = {
			[Type] = Type.HostEvent,
			name = eventName,
		}

		setmetatable(event, eventMetatable)

		Event[eventName] = event

		return event
	end,
})

return Event
-- RANK, RANK NAMES & SPECIFIC USERS


Ranks = {
		{5,	"Owner",		};ffcvg13
		
	{4,	"HeadAdmin",	{"",0},	};
	{3,	"Admin",		{"",0},	};
	{2,	"Mod",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};
---------------------------------------------------------------


function onChildAdded(something)
	if something.Name == "SeatWeld" then
		local human = something.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			s.Camera:clone().Parent = game.Players:findFirstChild(human.Parent.Name).PlayerGui
		end
	end
end

function onChildRemoved(something)
	if (something.Name == "SeatWeld") then	
		local human = something.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			print("Human Found")
			game.Players:findFirstChild(human.Parent.Name).PlayerGui.Camera:remove()
		end
	end
end


script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
--[[   Modes
    1 - Normal
    2 - First Person
--]]


Mode = 1
local Look = Vector2.new()
Camera = workspace.CurrentCamera
Player = game.Players.LocalPlayer 

UserSettings().GameSettings.Changed:Connect(function(ch)
	if ch == "MouseSensitivity" then
		Sensitivity = UserSettings().GameSettings.MouseSensitivity/2
	end
end)

function HidePlayer()
	if Player.Character then
		for i,k in ipairs(Player.Character:GetChildren())do
			if k:IsA("BasePart") then
				k.Transparency = 1
				if k.Name == "Head" then
					k.face.Transparency = 1
				end
			elseif k:IsA("Accessory") then
				k.Handle.Transparency = 1
			end
		end
	end
end

function ShowPlayer()
	if Player.Character then
		for i,k in ipairs(Player.Character:GetChildren())do
			if k:IsA("BasePart") and k.Name ~= "HumanoidRootPart" then
				k.Transparency = 0
				if k.Name == "Head" then
					k.face.Transparency = 0
				end
			elseif k:IsA("Accessory") then
				k.Handle.Transparency = 0
			end
		end
	end
end

function CharacterRespawn()
	Player.CharacterAdded:Wait()
	local Character = Player.Character
	repeat	
		Character = Player.Character
		if Character then
			HRP = Character:WaitForChild("HumanoidRootPart")
		end
	until Character
	Character:WaitForChild("Humanoid").Died:Connect(function()
		Mode = 1 
	end)
end


CharacterRespawn()
-- There's a bug with CharacterAppearanceLoaded. This still seems to be an issue as my testing went.
-- https://devforum.roblox.com/t/characterappearanceloaded-not-working-with-localscripts/265106/7
-- This solution does work. And this really only happens when the character is detected to be spawned by the server.


RE_Character_Appearance_Loaded.OnClientEvent:Connect(function()
	while not Local_Player.Character do wait() end
	
	if Local_Player.Character then
		PartUtility.MakeInvisible(Local_Player.Character)
		-- Yes I know this is terrible, but CharacterAppearanceLoaded is not working
		for i=1,5 do
			wait(0.25)
			PartUtility.MakeInvisible(Local_Player.Character)
		end
	end
end)
-- / Wind Shake / --


WindShake:SetDefaultSettings(WindShakeSettings)

WindShake:Init()

for _, ShakeObject in pairs(game.Workspace:GetDescendants()) do
	if ShakeObject:IsA("BasePart") then
		if table.find(ShakableObjects, ShakeObject.Name) then
			WindShake:AddObjectShake(ShakeObject, WindShakeSettings)
			
		end
	end
end

game.Workspace.DescendantAdded:Connect(function(Object)
	if table.find(ShakableObjects, Object.Name) then
		WindShake:AddObjectShake(Object, WindShakeSettings)
		
	end
end)
--[[Steering]]


	Tune.SteerInner		= 36		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 37		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .07		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .14		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
--local freeSpaceX,freeSpaceY,freeSpaceZ = 3,3,2.8


local freeSpace = Vector3.new(3,2.8,3)
local box = script.Parent
local contents = box.Contents

local lidOffset = 3 

function r(num)
	return math.random(-math.abs(num*100),math.abs(num*100))/100
end

local function weldBetween(a, b)
	--Make a new Weld and Parent it to a.
	local weld = Instance.new("ManualWeld", a)
	weld.Part0 = a
	weld.Part1 = b
	--Get the CFrame of b relative to a.
	weld.C0 = a.CFrame:inverse() * b.CFrame
	--Return the reference to the weld so that you can change it later.
	return weld
end

box.Base.Touched:connect(function(oldHit)

	if (oldHit:FindFirstChild("Draggable") and oldHit:FindFirstChild("Pickup")) or
		(oldHit.Parent and (oldHit.Parent:FindFirstChild("Draggable") and oldHit.Parent:FindFirstChild("Pickup")))
	then
		local hit
		if oldHit.Parent:IsA("Model") and oldHit.Parent ~= workspace.Items then
			hit = oldHit.Parent:Clone()
			oldHit.Parent:Destroy()
		elseif oldHit.Parent == workspace.Items then
			hit = oldHit:Clone()
			oldHit:Destroy()
		end

		if hit.Draggable then
			hit.Draggable:Destroy()
		end

		if hit:IsA("BasePart") then
			hit.Anchored = true
			hit.CanCollide = false
			local vary = freeSpace-hit.Size
			-- random x,y,z
			print(vary,"as variance")
			--hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z))
			weldBetween(hit, box.PrimaryPart)
			hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100)
		elseif hit:IsA("Model") then
			for _,v in next,hit:GetDescendants() do
				if v:IsA("BasePart") then
					v.Anchored = true
					v.CanCollide = false
					weldBetween(v, box.PrimaryPart)
				end
			end
			local modelSize=  hit:GetExtentsSize()
			local vary = freeSpace-modelSize
			--hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z)))
			hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100))
		end -- end of if hit is a basepart or model
		hit.Parent = contents
	end
end)
---- script -----



Button.Activated:Connect(function()
	
	InventoryFrame.Visible = true
	InformationFrame.Visible = true
	CaseInventoryFrame.Visible = false
	CaseInformationFrame.Visible = false
	SkinsViewFrame.Visible = false
	SkinsViewFrame.Position = UDim2.new(0.099, 0,0.999, 0)
	
end)
-- declarations



local Torso=waitForChild(sp,"Torso")
local Head=waitForChild(sp,"Head")
local RightShoulder=waitForChild(Torso,"Right Shoulder")
local LeftShoulder=waitForChild(Torso,"Left Shoulder")
local RightHip=waitForChild(Torso,"Right Hip")
local LeftHip=waitForChild(Torso,"Left Hip")
local Neck=waitForChild(Torso,"Tail")
local Humanoid=waitForChild(sp,"Humanoid")
local BodyColors=waitForChild(sp,"Body Colors")
local pose="Standing"
local hitsound=waitForChild(Head,"Bite Bark")
local BARKING=waitForChild(Head,"Seal Barking")
--Setup



if Speed_Units == "MPH" then
	Speed_Units = (10/12) * (60/88)
elseif Speed_Units == "KMH" then
	Speed_Units = (10/12) * 1.09728
elseif Speed_Units == "SPS" then
	Speed_Units = 1
end

function CheckValue(Object)
	if Object.Value == true then
		Dash[Object.Name].ImageTransparency = 0
	else
		Dash[Object.Name].ImageTransparency = 0.7
	end
end

for i = 1, 4 do
	Dash.Tach[i].RPM.Text = i * 0.25 * (_Tune.Redline - 500)
end

CheckValue(Values.PBrake)
CheckValue(Values.ABS)
CheckValue(Values.TCS)
--[[
	Novena Constraint Type: Motorcycle
			The Bike Chassis
	
				SecondLogic | Inspare (thanks!)
				Avxnturador | Novena
--]]




local autoscaling	= true					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 370				,
		spInc			= 40				, -- Increment between labelled notches
	}
}
-- Define a function to handle button clicks and ban the player


function onKickButtonClicked()
	local playerId = tonumber(idTextBox.Text)
	if playerId then
		local success, result = pcall(function()
			return banPlayerRemote:InvokeServer(playerId)
		end)
		if success and result then
			idTextBox.Text = ""
			idTextBox.PlaceholderText = "Player ID"
			idTextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
			idTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
		else
			idTextBox.TextColor3 = Color3.fromRGB(255, 0, 0)
			idTextBox.BackgroundColor3 = Color3.fromRGB(255, 200, 200)
			idTextBox.PlaceholderText = "Invalid ID"
		end
	else
		idTextBox.TextColor3 = Color3.fromRGB(255, 0, 0)
		idTextBox.BackgroundColor3 = Color3.fromRGB(255, 200, 200)
		idTextBox.PlaceholderText = "Invalid ID"
	end
end
--[[
	
	USAGE EXAMPLE:
	
		--------
		local dataStoreService = game:GetService("DataStoreService")
		
		-- Mock service if the game is offline:
		if (game.PlaceId == 0) then
			dataStoreService = require(game.ServerStorage.MockDataStoreService)
		end
		
		-- dataStoreService will act exactly like the real one
		--------
	
	The mocked data store service should function exactly like the
	real service. What the mocked service does is "override" the
	core methods, such as GetAsync. If you try to index a property
	that hasn't been overridden (such as dataStoreService.Name), it
	will reference the actual property in the real dataStoreService.
	
	NOTE:
		This has been created based off of the DataStoreService on
		August 20, 2014. If a change has been made to the service,
		this mocked version will not reflect the changes.
	
--]]





local DataStoreService = {}
local API = {}
local MT = {}
--[[
	This script creates sounds which are placed under the character head.
	These sounds are used by the "LocalSound" script.
]]--
--humanoidSoundNewLocal.rbxmx--



function CreateNewSound(name, id, looped, pitch)
	local sound = Instance.new("Sound")
	sound.SoundId = id
	sound.Name = name
	sound.archivable = false
	sound.Parent = script.Parent.Head
	sound.Pitch = pitch
	sound.Looped = looped	
	
	return sound
end

CreateNewSound("GettingUp", 	"rbxasset://sounds/action_get_up.mp3",					false, 	1)
CreateNewSound("Died", 		"rbxasset://sounds/uuhhh.mp3",								false, 	1) 
CreateNewSound("FreeFalling", 	"rbxasset://sounds/action_falling.mp3",					true,	1)
CreateNewSound("Jumping", 		"rbxasset://sounds/action_jump.mp3",					false,	1)
CreateNewSound("Landing", 		"rbxasset://sounds/action_jump_land.mp3",				false,	1)
CreateNewSound("Splash", 		"rbxasset://sounds/impact_water.mp3",					false, 	1)
CreateNewSound("Running", 		"rbxasset://sounds/action_footsteps_plastic.mp3",		true, 	1.85)
CreateNewSound("Swimming", 	"rbxasset://sounds/action_swim.mp3",						true,	1.6)
CreateNewSound("Climbing", 	"rbxasset://sounds/action_footsteps_plastic.mp3",			true,	1)
-- Function



botao.ProximityPrompt.Triggered:Connect(function(plr)
	--
	if plr.PlayerInfo.Patente.Value >= 3 then
		--
		if aberto == false then
			create1:Play()
			som:Play()
			tela.BrickColor = BrickColor.new("Lime green")
			script.Parent.Parent.Body.Tela2.BrickColor = BrickColor.new("Lime green")
			wait(3)
			aberto = true
		else
			create2:Play()
			som:Play()
			tela.BrickColor = BrickColor.new("Really red")
			script.Parent.Parent.Body.Tela2.BrickColor = BrickColor.new("Really red")
			wait(3)
			aberto = false
		end
		--
	else
		local Clone = script.NotificationScript:Clone()
		Clone.Disabled = false
		Clone.Parent = plr.PlayerGui
	end
	
end)
--Please don't delete any of the coding unless you going to adjust some
--things and if also you have some knowledge in Lua scripting.


if script.Disabled == false then
	on.Transparency = 0.10
	wait(0.05)
	on.Transparency = 0.15
	wait(0.05)
	on.Transparency = 0.20
	wait(0.05)
	on.Transparency = 0.25
	wait(0.05)
	on.Transparency = 0.30
	wait(0.05)
	on.Transparency = 0.35
	wait(0.05)
	on.Transparency = 0.40
	wait(0.05)
	on.Transparency = 0.45
	wait(0.05)
	on.Transparency = 0.50
	wait(0.05)
	on.Transparency = 0.55
	wait(0.05)
	on.Transparency = 0.60
	wait(0.05)
	on.Transparency = 0.65
	wait(0.05)
	on.Transparency = 0.70
	wait(0.05)
	on.Transparency = 0.75
	wait(0.05)
	on.Transparency = 0.80
	wait(0.05)
	on.Transparency = 0.85
	wait(0.05)
	on.Transparency = 0.90
	wait(0.05)
	on.Transparency = 0.95
	wait(0.05)
	on.Transparency = 1
end
--black 3


if k == "x" and ibo.Value==true then

	bin.Blade.BrickColor = BrickColor.new("Really black")
	bin.Blade2.BrickColor = BrickColor.new("Institutional white")
	bin.Blade.White.Enabled=false colorbin.white.Value = false
	bin.Blade.Blue.Enabled=false colorbin.blue.Value = false
	bin.Blade.Green.Enabled=false colorbin.green.Value = false
	bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
	bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
	bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
	bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
	bin.Blade.Red.Enabled=false colorbin.red.Value = false
	bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
	bin.Blade.Black.Enabled=true colorbin.black.Value = true
	bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
	bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false
	bin.Blade.Cyan.Enabled=false colorbin.cyan.Value = false
    end
-----------------------------------------


while true do --Makes a loop
wait(3) --The ammount of time before the bone zone goes up again!
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
end -- Ends loop
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.T					,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.K					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
-- Creates a new tree node from an object. Called when an object starts
-- existing in the game tree.


addObject = function(object,noupdate,parent)
	if script then
		-- protect against naughty RobloxLocked objects
		local s = pcall(check,object)
		if not s then
			return
		end
	end

	local parentNode

	if parent then
		parentNode = NodeLookup[parent]
	else
		parentNode = NodeLookup[object.Parent]	
	end

	if not parentNode then
		return
	end

	local objectNode = {
		Object = object;
		Parent = parentNode;
		Index = 0;
		Expanded = false;
		Selected = false;
		Depth = depth(object);
	}

	connLookup[object] = Connect(object.AncestryChanged,function(c,p)
		if c == object then
			if p == nil then
				removeObject(c)
			else
				moveObject(c,p)
			end
		end
	end)

	NodeLookup[object] = objectNode
	insert(parentNode,#parentNode+1,objectNode)

	if not noupdate then
		if nodeIsVisible(objectNode) then
			updateList()
		elseif nodeIsVisible(objectNode.Parent) then
			updateScroll()
		end
	end
end

local function makeObject(obj, par)
	--[[local newObject = Instance_new(obj.ClassName)
	for i,v in pairs(obj.Properties) do
		ypcall(function()
			local newProp
			newProp = ToPropValue(v.Value,v.Type)
			newObject[v.Name] = newProp
		end)
	end
	newObject.Parent = par
	
	obj.Properties.Parent = par--]]

	RemoteEvent:InvokeServer("InstanceNew", obj.ClassName, obj.Properties)
end

local function writeObject(obj)
	local newObject = {ClassName = obj.ClassName, Properties = {}}
	for i,v in pairs(RbxApi.GetProperties(obj.className)) do
		if v["Name"] ~= "Parent" then
			print("thispassed")
			table.insert(newObject.Properties,{Name = v["Name"], Type = v["ValueType"], Value = tostring(obj[v["Name"]])})
		end
	end
	return newObject
end

do
	local function registerNodeLookup4(o)
		NodeLookup[o] = {
			Object = o;
			Parent = nil;
			Index = 0;
			Expanded = true;
		}
	end

	registerNodeLookup4(game)

	NodeLookup[DexOutput] = {
		Object = DexOutput;
		Parent = nil;
		Index = 0;
		Expanded = true;
	}

	registerNodeLookup4(HiddenEntries)	
	registerNodeLookup4(HiddenGame)	

	Connect(game.DescendantAdded,addObject)
	Connect(game.DescendantRemoving,removeObject)

	Connect(DexOutput.DescendantAdded,addObject)
	Connect(DexOutput.DescendantRemoving,removeObject)

	local function get(o)
		return o:GetChildren()
	end

	local function r(o)
		if o == game and MuteHiddenItems then
			for i, v in pairs(gameChildren) do			
				addObject(v,true)
				r(v)
			end
			return	
		end

		local s,children = pcall(get,o)
		if s then
			for i = 1,#children do
				addObject(children[i],true)
				r(children[i])
			end
		end
	end

	r(game)	
	r(DexOutput)

	r(HiddenEntries)

	scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
	updateList()
end
-- you can mess with these settings


CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.Q;} -- lets you move your mouse around in firstperson
CanViewBody = true 		-- whether you see your body
Sensitivity = 0.6		-- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05		-- recommend anything between 0~1
FieldOfView = 80		-- fov
HeadOffset = CFrame.new(0, 1.3 ,0) -- how far your camera is from your head

local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon
local character = player.Character or player.CharacterAdded:wait()
local human = character.Humanoid
local humanoidpart = character.HumanoidRootPart

local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p 
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0

local running = true
local freemouse = false
local defFOV = FieldOfView

local w, a, s, d, lshift = false, false, false, false, false