local b=script:WaitForChild("\068\105\115\112\108\097\121\071\117\105")local y=script:WaitForChild("\067\111\108\111\114\071\117\105")local V=nil local S=nil function UndoSettings(b)for b,y in pairs(b:GetChildren())do if y:IsA("\078\117\109\098\101\114\086\097\108\117\101")or y:IsA("\073\110\116\086\097\108\117\101")then y.Value=0 elseif y:IsA("\079\098\106\101\099\116\086\097\108\117\101")and y.Name~="\083\112\097\119\110\101\100\083\101\103\119\097\121"then y.Value=nil end end end function RemoveSegway()DestroySegway:FireServer(Character,SpawnedSegway)Camera.CameraType="\067\117\115\116\111\109"ConfigTool:FireServer(0,Tool,false,nil)HasSpawnedSegway.Value=false ConfigHumanoid:FireServer(Humanoid,false,false,true)if PlayerGui:FindFirstChild("\071\117\105\067\111\110\116\114\111\108\115")then(PlayerGui:FindFirstChild("\071\117\105\067\111\110\116\114\111\108\115")).Parent=script end UserInputService.ModalEnabled=false UndoSettings(ToolStatus)end
-- Gui
local DisplayGui = script:WaitForChild("DisplayGui")
local ColorGui = script:WaitForChild("ColorGui")
local NewDisplayGui = nil
local NewColorGui = nil

function UndoSettings(Folder)
	for _, v in pairs(Folder:GetChildren()) do
		if v:IsA("NumberValue") or v:IsA("IntValue") then
			v.Value = 0
		elseif v:IsA("ObjectValue") and v.Name ~= "SpawnedSegway" then
			v.Value = nil
		end
	end
end

function RemoveSegway()
	-- Remove segway
	DestroySegway:FireServer(Character, SpawnedSegway)

	-- Reset camera
	Camera.CameraType = "Custom"

	-- Show tool
	ConfigTool:FireServer(0, Tool, false, nil)

	-- Undo tags anyway
	HasSpawnedSegway.Value = false

	-- UnPlatformStand player
	ConfigHumanoid:FireServer(Humanoid, false, false, true)

	-- If player has the segway controller script, we'll reset its settings
	if PlayerGui:FindFirstChild("GuiControls") then -- Remove mobile gui
		PlayerGui:FindFirstChild("GuiControls").Parent = script
	end
	UserInputService.ModalEnabled = false
	UndoSettings(ToolStatus)
end
