News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Damage multiplier script  (Read 4960 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 293
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: Damage multiplier script
« Reply #15 on: April 14, 2021, 04:51:57 PM »
It crashed before you added the "Wait(1000)" because you accidentally swapped the position of the "wait(0)" with "end".

The structure of a while true do is:
Code: [Select]
While true do
--Your code here
Wait(0)
end
Not:
Code: [Select]
While true do
end
Wait(0)
Fix this and you can get rid of that "Wait(1000)".

I've noticed you forgot to change the faction ID for the Jocks and Greasers and left 1, which is for nerds.
This means the game will never be able to find Damon and Norton because they're not part of the Nerd clique.
Derpy's Lua Reference site has lists of all kinds of stuff you might need.

Also, again, remember that (most) code is case-sensitive.
You typed "ped" in PedGetName(), when I programmed the for loop to work with "Ped".
« Last Edit: April 14, 2021, 04:56:50 PM by SimonBestia »

Offline Micha

  • Intelectual Wannabe
  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
    • View Profile
Re: Damage multiplier script
« Reply #16 on: April 14, 2021, 05:42:53 PM »
You were a hundred percent right, it works this way. The only thing I'm not sure about is the actual damage multiplier as I did not notice any significant difference in the damage Jimmy took and I can't see how much damage is being done exactly.
« Last Edit: April 14, 2021, 05:51:44 PM by Micha »

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 293
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: Damage multiplier script
« Reply #17 on: April 15, 2021, 02:32:17 AM »
It doesn't work because:
  • You changed PedSetDamageGivenMultiplier() to PedGetDamageGivenMultiplier().
    PedGetDamageGivenMultiplier() returns the value of the ped's current damage multiplier value. Don't think you need that.
  • The game is trying to find "ped" and not "Ped". Code is case-sensitive.

Offline Micha

  • Intelectual Wannabe
  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
    • View Profile
Re: Damage multiplier script
« Reply #18 on: April 15, 2021, 05:28:56 AM »
I tried this with two different methods but the multiplier didn't seem to have an effect on either of them.

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 293
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: Damage multiplier script
« Reply #19 on: April 15, 2021, 08:13:31 AM »
Because in both files you still have both "ped" and "Ped" in different places.
Looks like you hate that P, huh? lol
It's either "Ped" or "ped". You can't mix them.

Paste this commented line on top of your scripts so you don't forget:
Code: [Select]
--"Dear me: Remember code is case-sensitive."(Commented lines are ignored by the compiler, so you can have notes in your scripts and stuff)
« Last Edit: April 15, 2021, 08:17:17 AM by SimonBestia »

Offline Micha

  • Intelectual Wannabe
  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
    • View Profile
Re: Damage multiplier script
« Reply #20 on: April 15, 2021, 09:34:07 AM »
Yeah, I'm aware. I have ADHD so my attention span is not exactly good, I easily overlook this stuff if I don't specifically pay attention to it because else I assume I wrote it differently. It's an absolute pain in the arse   :blank: .

Anyways, I was also able to make the multiplier work for individual characters using Derpy's difficulty mod to apply this stuff. Unlike at the beginning, where I had no idea about what I was doing, this time I was able to identify which functions and parts of the main function were important to make the multiplier work because of what you already have shown to me.

I'll try to use your method again while paying more specific attention to case sensitivity. I know I can be difficult to deal with, but still thanks for showing me all this stuff.

Offline Micha

  • Intelectual Wannabe
  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
    • View Profile
Re: Damage multiplier script
« Reply #21 on: April 15, 2021, 05:05:15 PM »
Would this be the right approach to how you introduced the script or am I still getting it wrong?

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 293
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: Damage multiplier script
« Reply #22 on: April 16, 2021, 02:36:02 AM »
PedIsDead() checks for Ped instead of ped, so the script will get stuck there.

Offline Micha

  • Intelectual Wannabe
  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
    • View Profile
Re: Damage multiplier script
« Reply #23 on: April 16, 2021, 05:57:43 AM »
Now it finally worked, thank you for everything. You've helped a ton.