![]() |
copylevel?
Ok, I am trying to use copylevel(), cause I needed a way to make a new level through script, and some body told me to use it.
Now, I tried doing it, but it just wont work....at all. Heres my example: PHP Code:
Whats wrong? Or whats another way to make a new blank level through script? >< |
Quote:
|
I know that. lol
Do you see a //#CLIENTSIDE on my script? no. =/ And even if I dont have player.account in there, it still doenst work. I tried copylevel("test.nw","test2.nw"); copylevel("test.nw","levels/test2.nw"); but nothing works. x.x |
Should end up in your scriptfiles folder.
|
He assumed it was clientside because you're mixing clientside stuff in there.
You have to detect the players chat on the clientside, then trigger the serverside to copy the level. |
Quote:
|
Quote:
|
The problem isnt detecting the players chat. -.-
That works serverside too. Cause, when I have function onPlayerChats(){ if (player.chat == "/test"){ player.chat = "Sucess!"; } } it works. |
Quote:
|
Ok, now I have edited it...so, heres what I have now:
in the level: PHP Code:
PHP Code:
|
I've mentioned it a few times now and you just looked over me. :(
|
Quote:
To the one with the question, make sure your npcserver has rights to that folder. I can't think of any problems other than that if you're actually reaching the copylevel() function in your script. |
Simple example.
PHP Code:
|
Quote:
|
SCRIPT FIGHTS!! BLAHHhhh! First on to make me a gf out of scriptswins
|
Quote:
|
Quote:
|
In truth, I don't know about copylevel since I haven't used it since before the NPC Server security patch. I'm only going off what other file related functions do when the npc server has no rights to a file.
|
The "copylevel" command doesn't have special restrictions right now, although we should probably add some so that it cannot be abused.
copylevel("mylevel.nw","overworld/newlevel.nw"); will copy mylevel.nw to levels/overworld/newlevel.nw. "mylevel.nw" must be visible via /find, it doesn't need to be in some special folder. The destination path (levels/overworld) must exist, it is not creating the path. |
The way it used to work, was that it could NOT copy level from a folder and to the same one. Had to be copied TOO another folder.
|
In the NPC-Server's rights, add
rw levels/*.nw Here is an example of how to copy levels (GUI/Weapon-Script): PHP Code:
|
Quote:
|
| All times are GMT +2. The time now is 09:19 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.