M1s breaking when another player joins the server

Basically I want to make an m1 system. However, the damage only works for the first player who joins the server. Whenevrr anybody else joins they will just have 0 damage m1s.

	RightHand.Touched:Connect(function(hit)
		
		local ch = hit.Parent
		local humanoid = ch:FindFirstChildWhichIsA('Humanoid')
		
		local combat = char:FindFirstChild('Boxing')
		local DmgReduction = client:GetAttribute('Reduction')
		
		local m1cd = client:GetAttribute('M1DEBOUNCE')
		
		local gottenPlayer = Players:GetPlayerFromCharacter(hit.Parent)
		
		if DmgReduction < 2 then
			if combat and DmgReduction and humanoid and ch then
				if m1cd then
					
					HandleInput:FireClient(client, 'M1Count')

					client:SetAttribute('M1DEBOUNCE', false)
					
					if gottenPlayer then
						local dmgReduction = gottenPlayer:GetAttribute('Reduction')
						
						if DmgReduction < 2 then
							if dmgReduction > 0 then
								humanoid:TakeDamage(M1Damage / dmgReduction)
							else 
								humanoid:TakeDamage(M1Damage)
							end
						end
						
					else 
						
						humanoid:TakeDamage(M1Damage)
					end
					
					task.wait(M1Cooldown)

					client:SetAttribute('M1DEBOUNCE', true)
					
				end
			end
		end
		
	end)

There are zero errors everything is defined etc etc

I’ve seen countless topics like this, but I don’t know what an m1 system is. Can you explain what it is?

Also, what is your client script? Are players in the game explicitly defined?

M1 = Mouse Button 1 basically punches.

Yes everything is defined and its all working fine until someone else joins and idk.

These are all of the values.

||HandleInput:FireClient(client, 'M1Count')|
||client:SetAttribute('M1Cooldown', M1Cooldown)|
||client:SetAttribute('M1DEBOUNCE', true)|
||client:SetAttribute('Class', 'Combat')|
||client:SetAttribute('Reduction', 0)|
||client:SetAttribute('THEME', tostring(Color3.fromRGB(247, 222, 31)))|

I have no idea why it has those weird lines.They aren’t in the script.

Okay, what is client supposed to be? I suppose your script is a server script.

The player that joined the game.

I have fixed the problem the issue was that i had 0 second respawn time so I just replaced it with CharacterAppearanceLoaded and it worked!

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