Forum

> > CS2D > Scripts > spawning image and wall after destroying issue
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch spawning image and wall after destroying issue

Keine Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

verschoben spawning image and wall after destroying issue

olieo
User Off Offline

Zitieren
So i'm trying to create a script to spawn a box for each player who is online and hide it randomly around the map for them to find and destroy, doing it for just one box is easy but trying to use one image to create 1 box for each player is confusing me...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("join","spawn_box")
addhook("objectkill","move_box")

box = {}

function spawn_box(id)
	wall_x = math.random(1,9)
	wall_y = math.random(1,9)
	parse("spawnobject 3 "..wall_x.." "..wall_y)
	box_image_x = wall_x*32+16
	box_image_y = wall_x*32+16
	box[id] = image("gfx/GreedRPG/box.bmp",box_image_x,box_image_y,3)
end

function move_box(id,p)
	if object(id,"type") == 3 then
move image at the coordinates of the destroyed wall i to new random position and create new wall i at the new image position if the player who created that box still exists...

is there also a way to make the walls unique so players can build their own without it interfering with this script?
thanks for any help

EDIT: Sorry I posted in the wrong section by mistake
1× editiert, zuletzt 01.06.15 17:58:25

Admin/Mod Kommentar

Moved to right section /DC
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht