Forum

> > CS2D > Scripts > [Q] Spawn blocks
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [Q] Spawn blocks

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [Q] Spawn blocks

Iamle0
User Off Offline

Zitieren
Hey guys. Sorry me but i'm realy noob in lua.

How to spawn/create Env_Breakable using lua? So that's the question. If you know, then please write code.

alt Re: [Q] Spawn blocks

Heartless Soldier
User Off Offline

Zitieren
user Apache uwu hat geschrieben
A better solution would be to spawn walls, and place images over them.


ye, or make imaginary blocks. You can have a dictionary to save the "old" player position (x and y) and a table of two dimentions to save the blocks positions. With the tilemove hook you can know if the player moved to another tile, so you check if there isn't any block in that tile (i.e.: if block[newx][newy] ~= nil...), otherwise it sends the player to his/her last position (i.e.: parse("setpos "..id.." "..playerpos[id].oldx.." "..playerpos[id].oldy)). Then you just could add the blocks like block[X][Y] = true, and place an image over there if you want.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht