![]() |
Getting back into GS2
Well it has been like 2 years since I have touched Gscript and I am wanting to get back into it, so I started to make a lucky grab event script after reading a few guides on the internet, but I have found nothing about an event of when a player grabs a block... Here is what I have so far and please don't just give me the code, only hints ;) Also I have no way of testing this because there is never any admins on Testbed
For the npc in the level I thought it would be best to create a class and let the npcs join that class. PHP Code:
PHP Code:
|
I could be really wrong, it's been a while, but does removing '.gani' help?
I could also again be way off, things may have changed, but you could try prefixing the variable 'theNumber' with 'temp.' rather than 'var'? I remember that being the way to initialise variables within the scope of a function. A good, basic debugging tool is using 'echo' to check whether certain parts of your code are being executed. It's also useful for dumping state. I'm sure I remember there being a proper debugger written in GS some where too that may be useful. One thing you could try is: PHP Code:
|
It's actually player.ani, not player.gani. Also, said variable points to an object. player.ani.name is the actual name of the current gani.
That stuff aside, your grab check will probably not work like this, since onPlayerTouchsMe() is fired before you have the chance to actually grab the object. |
Quote:
|
Quote:
|
All times are GMT +2. The time now is 09:15 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.