Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

I suck at math but i need a random attack damage generator?

Asked by 7 years ago
Edited 7 years ago
 players can have weapons damage up to 15
 their attack damage can be changed by stats points when they reach level 15 
 there's also Defence that can be changed by stats points

What I'm trying to do

so I'm trying to make a random attack damage script, but as the title said, I am not good at math. and I don't want players being too Overpowered all the time, but it can happen sometimes.

i know i'm not supposed to ask for a script without trying, but the math part is the part that's bad for me

0
i know how to use random numbers. but that still doesnt help with the math part :( RobloxianDestory 262 — 7y
0
Try to use a formula like x = math.random(5) damage = (x*5)-10 so even if it's 5 the max will be 15 though it limits the range of damage. Meltdown81 309 — 7y
0
if i wanted to add the player's defense to that, would i divide it? RobloxianDestory 262 — 7y
View all comments (6 more)
0
No, you'd subtract the defense from it before applying the damage to the humanoid. Meltdown81 309 — 7y
0
damage can get up to 1000 or more if a lucky hit, and some NPCs wont have that much HP RobloxianDestory 262 — 7y
0
Are you asking for a basic formula for weapons in general or multiple for specific weapons? Meltdown81 309 — 7y
0
all weapons. sorry D: i never have been good at math. i tried to do a formula but i couldnt think of one RobloxianDestory 262 — 7y
0
why is math.random alone not sufficient for this Perci1 4988 — 7y
0
Percil Ever played an RPG before. They use formulas for their attacks based on stats and the skill/attack the character is using. Meltdown81 309 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Well if you want different weapons to do different amounts of damage I'd do something like this: x =player strength w = weapons attack Sword Formula- (x+w)+(x*1.5) or 2xw or 1.5x+w The weapons will do pretty good damage and if you want varied damage you can just use math.random(10) and add it to the end of the formula.

Ax Formula- 2x + w + 20 or 2xw + (x+w) or xw/(w-x) Axes are supposed t do alot of damage so I guess this works. You'll have to tweak them so they won't be to overpowered. Just play around with numbers and you'll get the hang of it.

0
i used the first one. with 0 wep damage and 5 attack damage, it print 12.5 (x+w)+(x*1.5) is the one i used RobloxianDestory 262 — 7y
0
Is that okay? Meltdown81 309 — 7y
Ad

Answer this question