Forum

> > CS2D > Maps/Editor > Toll Door
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English Toll Door

2 replies
To the start Previous 1 Next To the start

old Toll Door

Keanu Reeves
User Off Offline

Quote
how to make a script in the map editor and Lua so that when the button is clicked, the player will spend money and open the door.

old Re: Toll Door

SkullFace
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("use","use_button")
function use_button(id,event,data,x,y)
	local money = player(id,"money")
	if (x == 00 and y == 00) or (x == 00 and y == 00) then
		if money>29 then
			parse("trigger 'DoorName' ")
			parse("setmoney "..id.." "..(player(id,"money") - 30))
		end
	end
end

In
(x == 00 and y == 00)
replace the
00
with the coordinates where the Trigger_Use is.
In
money>29
replace the
29
with the amount of money you can't pay the toll with.
In
("trigger 'DoorName' ")
replace the
'DoorName'
with the Dyn_Wall's name.
In
("setmoney "..id.." "..(player(id,"money") - 30))
replace the
- 30
for the amount of money it is required to open the door.
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview