wait(1)me=script.Parent plr=game.Players.LocalPlayer gui=plr.PlayerGui.ScreenGui.Main.TowerInfo while true do wait()if me.objTower.Value==nil then me.Visible=false else obj=me.objTower.Value me.Visible=true local a=obj:FindFirstChild("\079\119\110\101\114")if a then gui.txtOwner.Text=a.Value end temp=obj:FindFirstChild("\067\111\110\102\105\103")if temp~=nil then gui.txtDamage.Text=obj.cfgDamage.Value gui.txtSpeed.Text=obj.cfgSpeedAttack.Value types=temp.DamageType.Value if types==1 then gui.txtType.Text="\083\105\110\103\108\101"gui.txtRadius.Text=obj.cfgRadius.Value elseif types==2 then gui.txtType.Text="\065\111\069"gui.txtRadius.Text=obj.cfgRadius.Value elseif types==3 then gui.txtType.Text="\067\111\110\116\097\099\116"gui.txtRadius.Text=" - "else gui.txtType.Text=" \063\063\063 "end else gui.txtDamage.Text=" - "gui.txtRadius.Text=" - "gui.txtSpeed.Text=" - "gui.txtType.Text=" - "end end end

wait(1)

me = script.Parent
plr = game.Players.LocalPlayer
gui = plr.PlayerGui.ScreenGui.Main.TowerInfo


while true do
	wait()
	
	if me.objTower.Value == nil then
		me.Visible = false
	else
		obj=me.objTower.Value
		
		me.Visible = true
		--		print(obj.Name)
		local val = obj:FindFirstChild("Owner")
		if val then 
			gui.txtOwner.Text	= val.Value
		end
		temp=obj:FindFirstChild("Config")
		if temp ~= nil then	-- не кристалл
			gui.txtDamage.Text	= obj.cfgDamage.Value
			gui.txtSpeed.Text	= obj.cfgSpeedAttack.Value
			-- вывод типа урона
			types = temp.DamageType.Value		
			if types == 1 then
				gui.txtType.Text= "Single"
				gui.txtRadius.Text	= obj.cfgRadius.Value
			elseif types == 2 then
				gui.txtType.Text= "AoE"
				gui.txtRadius.Text	= obj.cfgRadius.Value
			elseif types == 3 then
				gui.txtType.Text= "Contact"
				gui.txtRadius.Text	= " - "
			else
				gui.txtType.Text= " ??? "
			end
		else -- кристалл
			gui.txtDamage.Text	= " - "
			gui.txtRadius.Text	= " - "
			gui.txtSpeed.Text	= " - "
			gui.txtType.Text	= " - "
		end
		
	end
end
