![]() |
Using a NPC to move tiles: Help!
I'm making a jousting arena, but the ET member who controls it sits in a seat INSIDE the arena, making him vunerable to attacks. I want to do two things:
I want, when the ET member says something like begin judging that a tile hides for 3 seconds, then the ET member goes in side and sits in the seat, and is protected. I also want, to move the player out of the level when he/she dies, or into a graveyard part on the field. I also want to incorporate this into a boot function, only accessible by ET members. How would I do that? Help is greatly appriecated. My current PvP herald code: NPC Code: The setlevel2 was my original means, but i cant get it to work in the Offline test. |
Well, first of all, the superjoust thing should use a for loop, considering it's the same thing five times in a row.
Now, as for the whole the-ET's-vulnerable-hide-tiles-then-he's-safe thing, could you be a bit more specific of what you want to happen? And as for the go-to-a-graveyard-when-dead thing, I would just set the playerx and playery to whatever when playerhearts = 0, but I only know that would work offline. I'm not exactly sure how you access a given player's variables except through direct account association (with (account))... but yeah, I think that should help a bit. |
To change tiles via a script, you can access the tile array directly using tiles[y][x]=integer; and then updating the tiles with updateboard x,y,width,height;
to get the tile ID's, go into the editor and select a tile (draw a box around one tile) then go up to the toolbar and click on the thing that looks like four cobbles. that will give you the ID of that tile (use that as the value in the tiles[][] array) tiles[0][0]=0x00; will replace the top left tile with the left side of the two-tile grass tuft. note, the level is 64x64, so you can do up to tiles[64][64] you -must- to updateboard in order to have the new tile display on the level without having to re-enter the level (or at least move so the tile you changed is off-screen) before it will update. |
Okay, i'll be a little more specific (thanks calani, i now understand how to do it.) with the booting thing:
When a player dies, i want him/her off the map. Or warped to a co-ordinate on the current map so they can exit thorugh a door. I've tried setlevel2 when playerdies, but it doesnt work. |
Check if the player has been hit. Check if the players HP hits 0, if yes setlevel2.
|
Yes (playerdies) doesn't work right, if at all. I remember getting it to work two or so years ago on babylon, but it could be depreciated in the current release.
check the player's HP in a timeout loop (all you'll need is .5 or so: no need to check it 20 times a second) |
| All times are GMT +2. The time now is 04:32 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.