Author Topic: few questions  (Read 690 times)

1. How could I detect when a player right clicks, and do something, like making him jump or lose health?
2. is there any way to detect the name of the brick, and do stuff to it like making it also do something like killing the player when he/she activates the named brick
3. wtf am i doing wrong: http://pastebin.com/F1bjTDBw

1. Search the forum for an example of armor::ontrigger

2. If you have the brick object, I believe it's just .getName()
As for "activating" the brick, do you mean an output event to be triggered by an onActivate input event? If so, just do similar (but fixed) to what you tried in #3. If not, you'll need to also use ontrigger, as well as a raycast (look up an example of that), and a few checks to make sure it's a brick/right type of brick/right name

3. Your client variable is actually a player. Rename it %player to better describe what it contains, and then use %player.client when you need the client.
%this is also an incorrect name. Standards-wise, it should only be used to describe the object a method is being called on, and as such it should only ever be the first argument

So in summary, change
function Player::addLap(%client, %this)
To
function Player::addLap(%this, %laps)
Change any reference to %client to %this.client, and any reference from %this to %laps
« Last Edit: June 08, 2015, 10:46:55 AM by Headcrab Zombie »

still getting a gay syntax error around the P in Player, wtf am i doing wrong still

If you mean the player in registeroutputevent, then put it in quotes
If that's not it then post new code and screencap/text of error


Post the code a few more lines up. Usually that kind of error means it's somewhere near the current error outside of the line




Your problem is that you never close or activate the package.

Another problem is that you can't put function calls (such as your registeroutputevent) inside a package.
Also you still have a reference to undefined %client that needs to be changed to %this.client
« Last Edit: June 08, 2015, 01:31:23 PM by Headcrab Zombie »

ok i fixed everything thx
edit: how could i make a bottom print loop? nvm
« Last Edit: June 08, 2015, 01:45:04 PM by Hawt »

Another error is that the line registerOutputEvent(fxDTSBrick, setSuperKartLaps, int 0 6 3, 1); needs quotation marks around the int 0 6 3 part. Anything with more than one word needs quotation marks around it.