View Single Post
  #1  
Old 10-07-2012, 11:39 AM
Vatec Vatec is offline
Lurking
Join Date: Oct 2012
Posts: 27
Vatec is on a distinguished road
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:
function onCreated()
{
    
this.join("luckyGrabBlock");

Next I worked on the class, I am no sure about the file naming either

PHP Code:
function onCreated()
{
    
setimg("block.png");
}

//Not sure about the function so I tried this

function onPlayertouchsme()
{
    if(
player.gani == "grab.gani"//Not the right way to check gani?
    
{
        var 
theNumber random(0,1); //Not sure this works
        
if(theNumber == 0)
        {
            
player.setlevel2("level.nw",  3030); //What should I use before setlevel2
        
}
    }
}

//This is serverside to prevent hackers... It might cause a problem though... Not sure
//Also remember I have no way of testing this x.x 
__________________


Quote:
Originally Posted by GULTHEX View Post
so i think the problem is that onactionclientside isint a real function
Reply With Quote