I want to make a gun game system where the weapons have different abilities but im not sure how to switch the weapons was thinking about doing a for i,v loop through a folder of the different weapons choosing a random weapon and putting it in the players backpack but I dont know how I would make the weapon switch when the player kills another player. Thanks
To make the weapon switch when you kill a player, look for a hit variable inside the guns main script that dictates what to do, and add a line that fires a remote event, and a script in sss gives a random tool from replicated storage to whatever player fired the remote event.
You could have a string value in every single weapon that has the owner’s(player’s) name on it via script, then using raycasting, create a hit variable.Like @RealMysticall said. Since you can’t use a server script to find the “killer” I would advise using a Remote event or function
I’m not using raycasting but im using the mouse position and body movers should I switch to raycast?
Yes, that is the main way that essentially every gun game works, It is more accurate and not as hard to check if something hit someone