Forum

> > CS2D > Scripts > change map=change script
Forums overviewCS2D overview Scripts overviewLog in to reply

English change map=change script

5 replies
To the start Previous 1 Next To the start

old change map=change script

tos12345678
User Off Offline

Quote
Hi, i need function to change script when change map
× TESTXD.map
× TESTXD.lua
Because other players easy edit my script in lua

old Re: change map=change script

tos12345678
User Off Offline

Quote
Okey... EXAMPLE I...

Start zm.dust2.map = Start Specified my selected script. •

EXAMPLE II

When Play on (zm.dust2.map) = ON script : (zombiemod.lua) in sys/lua) us

old Re: change map=change script

GeoB99
Moderator Off Offline

Quote
Pretty sure he means whenever the map is changing, the specific script will be changed too. You can just rename your map.lua file to the name of the map and put it in the maps folder. In another way, you can do with this simple code (that code it's not really mine though).
1
2
3
4
5
if ((string.len(map("name") > 2) and (string.substr(map("name"), 2) == "zp")) then
     dofile("ZombiePlague.lua")
else
     dofile("Default.lua") 
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview