Results 1 to 6 of 6

Thread: Script bug

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Script bug

    Hello Guys, I have got a bug, which is for me very hard to fix it, I really don't know why that happens:

    I made a new key, so if someone is on killstreak 5, then the script ist waiting for the button K (so self waittil("key_k").
    So if Player 1 killed Player 2, then Player can't spawn, but if Player 1 is pressing K, then Player 2 is spawning.
    Why this happens? I didn't added specifically in PlayerKilled or spawnPlayer.

    Can somebody help me please?
    Thank you!

  2. #2
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Can you please show the actual code involved in it ? cuz I can't rlly tell any error in it, unless I've got some point, anything.
    And why are you using waittill?

  3. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Like Yuri said, we need some code. It sounds like a missing "thread"
    timescale 0.01

  4. #4
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    There is nothing missing. Just if I use "waittill" ( self waittill("key_k"); ), then the player 2 will not respawn, he will be respawn if player 1 press the key K ( so cause of the self waittill("key_k"); ). Can't I use something else (so not waittill)?

  5. #5
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    There is nothing missing. Just if I use "waittill" ( self waittill("key_k"); ), then the player 2 will not respawn, he will be respawn if player 1 press the key K ( so cause of the self waittill("key_k"); ). Can't I use something else (so not waittill)?
    When you use waittill() you need to thread to it, otherwise the code will stop you doing anything else while it is running. This explains why your player wont respawn, because the code is "stuck" in the loop waiting for "key_k" notification, and can't move on.

    PLEASE POST YOUR CODE.

    If you refuse to post your code, no one will be able to help you.

  6. The Following User Says Thank You to Tally For This Useful Post:

    Loveboy (21st December 2013)

  7. #6
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    The script what I use works now, my friend fixed it.
    Tally has got right, I didn't thread it to the script. The key K will be able to use it by Killstreaks.
    So on Callback_PlayerKilled() it was before:

    Code:
    attacker.killstreak++;
    attacker maps\mp\gametypes\_killstreak::getReward();
    Now it looks so:

    Code:
    attacker.killstreak++;
    attacker thread maps\mp\gametypes\_killstreak::getReward();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •