Forum

> > CS2D > Scripts > what wrong??
Forums overviewCS2D overview Scripts overviewLog in to reply

English what wrong??

5 replies
To the start Previous 1 Next To the start

old what wrong??

Eternal
User Off Offline

Quote
Hello i have a problem , This is problem
when i build teleporter entrance then show me this messages " You can't build here " but buildings have been built

This is code

Spoiler >

old Re: what wrong??

EngiN33R
Moderator Off Offline

Quote
Your problem is that you build on a position where you can't build anything by default and see the message, but as you have a script that places a building where you want to place it regardless of the position, it places it nonetheless. You could do what user MikuAuahDark advises.

old Re: what wrong??

Spook MQ Hacker
BANNED Off Offline

Quote
Spoiler >


not tested and i am a LOOSER making script...

old Re: what wrong??

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("buildattempt","fastbuild")
function fastbuild(id,type,x,y)
	if tile(x,y,"walkable") then
		if type==13 then
			parse("spawnobject "..type.." "..x.." "..y.." "..player(id,"rot").." 0 "..player(id,"team").." "..id)
			parse("setmoney "..id.." "..player(id, "money") - 3000)
			return 1
		end
	end
end

Since you still haven't figured it out, here's your original code with a little fix. This will only allow you to place buildings on walkable tiles - that is, not walls and obstacles. I think that's what you need.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview