It works here, but it activated straight away because it still sees a player on the ground so i added a wait 0.1 before "self thread SpikeRadiusDamage" but then the function doesnt work and i dont get the iprintln from that function... Any ideas?
Well first of all, I'd like to see where your trying to add this wait - cause you might just be putting it in the wrong spot. Secondly, is your gravity spike weapon named "zombie_shotgun"?
Well first of all, I'd like to see where your trying to add this wait - cause you might just be putting it in the wrong spot. Secondly, is your gravity spike weapon named "zombie_shotgun"?
I am putting wait at
Code Snippet
Plaintext
gravity_spikes_main() { if (self isonground()) { iprintln("Ground Activate"); self SetVelocity( (AnglesToUp(self.angles + (6,0,0))) * 1000); wait 0.1; //wait is here, but then it doesnt work when i try threading? self thread SpikeRadiusDamage(); } else if (!self isonground()) { iprintln("OffGround Activate"); self SetVelocity( (AnglesToUp(self.angles + (600,0,0))) * -1); } }
And i just have it set to zombie_shotgun (Yes I do give zombie_shotgun, just incase you were wondering) atm because i plan on modelling the gravity spikes later, but just want to get the script basics working.
Last Edit: October 15, 2015, 06:28:09 am by Eternal_Fire
That's quite odd, cause looking at it there should be no issue with putting the wait there. I would recommend putting an iprintln right after the wait and another right at the beginning of SpikeRadiusDamage() just to see where the issue occurs.
Also, now that I've read through your script I can see a couple other issues as well:
Code Snippet
Plaintext
self endon( "disconnect" );
This won't do anything since its in the init function and not called on a player. You should move that into the beginning of the weapon_check() function.
Secondly I see a little bit of a logic error, if the player isn't on the ground after the wait then it won't do the damage, so you could replace the wait with a while loop that waits until the player is on the ground.
while(!self isonground()) // wait for player to land wait(0.05);
self thread SpikeRadiusDamage(); } }
Also I don't really get what your doing with the setVelocity - but if that works then whatever lol
Edit: I also forgot to mention you can remove the if(self IsOnGround()) statement from the SpikeRadiusDamage() function as well, since the checks are now done in the gravity_spikes_main() function.
Last Edit: October 15, 2015, 06:40:52 am by JBird632
That's quite odd, cause looking at it there should be no issue with putting the wait there. I would recommend putting an iprintln right after the wait and another right at the beginning of SpikeRadiusDamage() just to see where the issue occurs.
Also, now that I've read through your script I can see a couple other issues as well:
Code Snippet
Plaintext
self endon( "disconnect" );
This won't do anything since its in the init function and not called on a player. You should move that into the beginning of the weapon_check() function.
Secondly I see a little bit of a logic error, if the player isn't on the ground after the wait then it won't do the damage, so you could replace the wait with a while loop that waits until the player is on the ground.
Also I don't really get what your doing with the setVelocity - but if that works then whatever lol
Yeah thanks for the disconnect help, forgot that i hadnt defined self. Ech the script logic, just realised XD thanks. Yeah im just messing around with the velocity atm seeing what fits best. Thank you for the help
1. gravity_spikes_upgraded_main() isn't a defined function, so you will get an undefined function error. 2. Your while loop in SpikeRadiusDamage() has no wait in it and this will give you an infinite loop error. 3. Logically it doesn't make sense for your while loop to even be there, basically if the player is on the ground then it just keeps doing a radius damage forever. 4. You do not need to recursively call weapon_check() if its already on a loop
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
1. gravity_spikes_upgraded_main() isn't a defined function, so you will get an undefined function error. 2. Your while loop in SpikeRadiusDamage() has no wait in it and this will give you an infinite loop error. 3. Logically it doesn't make sense for your while loop to even be there, basically if the player is on the ground then it just keeps doing a radius damage forever. 4. You do not need to recursively call weapon_check() if its already on a loop
1. It is defined, i just didnt include it in the script i was showing because it is the same as gravity_spikes_main() because i havent worked on it yet.
2/3/4 I made it so it would do the radius damage then it would thread weapon check which would then wait til the player fired again and loop around... thought that would work... Double Post Merge: October 18, 2015, 08:26:08 am