Weapon System Breaking After Death

Hello there,

I have an intermediate-advanced combat system that for some reason works fine in Studio Play-Test, but not in the actual Roblox game when it is fully published.

The issue is that when I try to test out the game in Play-Test, the combat system works just fine, and I can rest character or die of something else and have it work. However, in Roblox, when my friends test it, and they die, the combat system completely breaks.

I have tried using functions, and way later on I actually resorted to Roblox Assistant and ChatGPT to figure out what is wrong with the system; but I still could not get it to function properly.

I have some Pastebin links because the client side is already really long, and so is the server side. Please let me know if the links cannot be accessed. Thank you. Also, I apologize for sending really long scripts and requesting assistance with what appears to be difficult to fix.

looked at your code pretty briefly and I think it might be to do with the ClientSource code
specifically the initialisation of your Character

I don’t know where you put the ClientSource code but if it’s in StarterPlayerScripts I know why it’s not working

Possible Problem
local character = player.Character

Possible Solution
local character = player.Character or player.CharacterAdded:Wait()

the reason why it’s not working is because when the character is respawned it doesn’t reinitialise the character which would halt the script due to WaitForChild() causing Infinite Yield

When characters are ‘deleted’ they aren’t deleted immediately atleast for their parenting which is why you can still access them

– Waits for Humanoid with no character that no longer exists –
local humanoid = character:WaitForChild(“Humanoid”)

I highly recommend you do some debugging to check if certain inputs or actions are being processed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.