I want to achieve this damage calculation actually do the damage as well, not just calculate it.I am trying to figure out a way to do it without having errors and crashing the module script. I am usually able to figure out problems on my own but have no experience with module scripts
What is the issue? Include screenshots / videos if possible!
I looked on DevHub searched everywhere, watched mr blox table/metable videos and other peoples. I have spent over 4 10 hour days trying to find a way to make this work in modulescript correct math is applied to the basedamage number value but nil to attributes crashes the module script i think, as well the damage is not applied
ya all my int values are created through my attributes gui its reading attributes and calculating the damage properly, hitdamage is 11 6dex/2 is 3 making it 14 i think the issue is the players data is not in the table/metatable and ive tried so many ways to put it in the module script and nothing works
You can’t actually get the LocalPlayer in a module script unless it’s a client side module script, however you can send the LocalPlayer through a LocalScript to the module.
so all the scripts are in replicated storage other than the 4 in the tool itself.
Bulletweapon module script is the only script that calls the HitDamge Numerical value so i started there to add my math equation to add the damage per dexterity
It looks like the module is run on both server and client as part of the system (note the localPlayer variable in the module is false when on the server, and the LocalPlayer when on client).
Instead of trying to directly access the player, make use of the BaseWeapon class’s own property, self.player, which is available inside both BulletWeapon and BowWeapon. This should return the correct player, both on the server and the client.
bro OMG OMGOMGOMG I LOVE YOU SO MUCH, i swear i tried this before and it didnt work, must have CAPS the wrong letter or something everythings working as intended now no errors monsters taking damage <3<3<3