Game treats every player as one

Hi there. I had just released my game on Roblox (you can play it here), and to see how my players were doing, I suddenly saw the screen fade to black multiple times. I then realized that was the death effect, and the game is treating every individual player as if it were one single player.

I don’t know what to do, or how to fix this aside from limiting the server size to 1, which I don’t want to do. Is there any way I can fix this?

2 Likes

Could uou show us the code?

1 Like

Do you have a server-side script instead of a local script parented to the death UI? This might be the reason, since server-side scripts are ran for every single player

This is what I got.

	elseif part.Name == "hurt" then
		if hurtdebounce == false and hitdebounce == false then
			hurtdebounce = true
			hitdebounce = true
			humanoid:ChangeState'Physics'
			local oldcamtype = cam.CameraType
			cam.CameraType = "Watch"
			if part:FindFirstChild("Config") then
				local soundname = part.Config.Sound.Value
				local tripsound = script.Sounds:findFirstChild(soundname):Clone()
				tripsound.Parent = humanoid.Parent.Torso
				tripsound:Play()
				game.Debris:AddItem(tripsound, 2)
			end
			if part.Config:FindFirstChild("Sound2") then
				local soundname = part.Config.Sound2.Value
				local tripsound = script.Sounds:findFirstChild(soundname):Clone()
				tripsound.Parent = humanoid.Parent.Torso
				tripsound:Play()
				game.Debris:AddItem(tripsound, 2)
			end
			FadeToDead()
			humanoid:ChangeState'GettingUp'
			task.wait(.1)
			local sl = game.Workspace.Checkpoints:FindFirstChild(ls.Stage.Value)
			humanoid.Parent.Torso.CFrame = sl.SpawnLocation.CFrame
			cam.CameraType = "Scriptable"
			cam.CoordinateFrame = sl.SpawnLocation.CFrame * CFrame.Angles(-.25, 0, 0) --Rotate by the angle
			cam.CameraType = oldcamtype
			humanoid.Parent.Torso.Anchored = false
			task.wait(.1)
			cam.CameraType = "Custom"
			PlatformingMode.Disabled = false
			SkydivingMode.Disabled = true
			SpeedMode.Disabled = true

			FadeFromDead()

		end

Only thing i can think of because i just speed read ig is a local is are you checking if the player who touched it is tye local player

Yup, the variable player refers to game.Players.LocalPlayer.

Can you share more context about how the death event is triggered and responded to? Like what event is it listening to, how is it being connected? Any remote events being fired in the process?

1 Like

the game has 114 favourites when it only has 107 visits :skull::skull::skull:

1 Like

What is the FadeToDead function defined as? Also, we would need the full code for the death screen and maybe where the script/localscript is.

Maybe try
local playertouched = players:GetPlayerFromCharacter(otherpart.parent) if localplayer.UserId == playertouched.UserUd then becuase this using help me

2 Likes