//Blue shoe config for sonic. from xmomentum
//The Command Shit
local function BlueShoes(player, arg)--Conjunction junction, what's your function?
	if player.mo and player.mo.valid
		if arg
			if arg == "on" or arg == "1" or arg == "true" or arg == "yes"--for the dummy these are numbers, but they can be strings, but you'll have to call the read differently
				player.blueshoes =  1
				CONS_Printf(player, "Sonic's shoes are now blue!")
				if io and player == consoleplayer--this section calls to save the data
				end
			elseif arg == "off" or arg == "false" or arg == "0" or arg == "no"--same thing but different answer
				player.blueshoes =  2
				CONS_Printf(player, "Sonic's shoes are no longer blue.")
				if io and player == consoleplayer
				end
			end
		else
			CONS_Printf(player, "Changes the colors of Sonic's shoes.")
		end
	else
		CONS_Printf(player, "This command only works in a stage.")
	end
end

COM_AddCommand("blueshoes", function(player, arg)--This adds the command
	BlueShoes(player, arg)--Tells command what function to do
end)




addHook("PlayerThink", function(p)
	if not p.bot
		if p.mo and p.mo.valid and p.mo.health
			if p.mo.skin == "sonic" and p.blueshoes == 1
				p.mo.skin = "blueshoessonic"
			end
			if p.mo.skin == "blueshoessonic" and p.blueshoes == 2
				p.mo.skin = "sonic"
			end
		end
	else
		if p.mo.skin == "sonic" and players[0].blueshoes == 1
			p.mo.skin = "blueshoessonic"
		end
		if p.mo.skin == "blueshoessonic" and players[0].blueshoes == 2
			p.mo.skin = "sonic"
		end
	end	
end)