Forum

> > CS2D > Scripts > Lua error, mp_unbuildable
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua error, mp_unbuildable

5 replies
To the start Previous 1 Next To the start

old Lua error, mp_unbuildable

SkullFace
User Off Offline

Quote
So... I need help with this command in LUA scripting.

It seems I can't make some buildings be unbuildable.

Here's the problem

1
parse("mp_unbuildable Wall 1,Wall 2,Wall 3,Teleport Entrance,Teleport Exit,Gate Field,Supply")

old Re: Lua error, mp_unbuildable

DC
Admin Off Offline

Quote
quotation fail.

try
1
parse('mp_unbuildable "Wall 1,Wall 2,Wall 3,Teleport Entrance,Teleport Exit,Gate Field,Supply"')

background: cs2d cmd mp_unbuildable requires ONE single string containing the building(s). you have to put quotes around it in order to tell the CS2D parser that it is one big string.
edited 2×, last 07.08.11 05:39:52 pm

old Re: Lua error, mp_unbuildable

Bowlinghead
User Off Offline

Quote
Try this:
1
2
3
4
5
6
7
parse("mp_unbuildable Wall 1")
parse("mp_unbuildable Wall 2")
parse("mp_unbuildable Wall 3")
parse("mp_unbuildable Wall 1")
parse("mp_unbuildable Teleport Entrance")
parse("mp_unbuildable Teleport Exit")
parse("mp_unbuildable Supply")

Oh. DC was faster
edited 1×, last 07.08.11 05:39:37 pm

old Re: Lua error, mp_unbuildable

DC
Admin Off Offline

Quote
@MC_Bowlinghead: this is not going to work. you will overwrite the setting each time. your configuration well end up with only the Supply being unbuildable.

old Re: Lua error, mp_unbuildable

Apache uwu
User Off Offline

Quote
You could make it a function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function unbuild(building)
	if buildings==nil then
		buildings=building
	else
		buildings=buildings..","..building
	end
	parse("mp_unbuildable \""..buildings.."\"")
end

unbuild("Wall I")
unbuild("Wall II")
unbuild("Teleporter Entrance")
unbuild("Teleporter Exit")
unbuild("Supply")

But if you know which ones that you want disabled it is just better to concat them yourself.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview