Hello Scripters! I need some help on a kill a zombie for money script that im making. I have made a script but it only works when I kill the zombie with a classic sword. However when i kill it with a gun it doesn’t work. I think I know why: The script cant tell who killed the zombie, because the guns bullets dont have any info about who shot it. Now, that makes sense but I dont know how to script this to work. The gun I am using is extremely complex (At least for me) but I dont think it will be hard to edit to make it to have info about who shot it. Anyways, this is the gun i am using. The AR gun from the weapons kit provided by ROBLOX. Here is a link to get it: Auto Rifle - Roblox
Ok so now here is the current script that I am using that only works with the classic sword:
Can anyone help me now to make the script be able to identify who shot the gun by making the gun put info about who shot it into each bullet? Or whatever needs to be done to make it work. If you would like more info, just ask!
If you’re using remote events for the bullets then when you call the event it will always contain the player who fired it inside of the server script just make the first parameter “player”.
Here you go, made this up in a few minutes so you can get the basics.
It’s uncopylocked so you can view all the code. You will notice in server script storage the function
local function onCreatePart(player, partColor, velocityInput) in the script FireballHandler, the first parameter stores the player who fired it.
Ah okay, so basically that is your player itself inside game.Players. So if you are accessing money from that or something it could be in player.Stats.Money or however you have it laid out. If it’s stored in the character it would be player.Character.Money or wherever you have it.