[SOLVED] Touched Event not working Between Players

Hello, I’m trying to make a hide and seek game where if the seeker touches the player, the player dies
I’m using Touched event that works for NPCs but not other players

	local Players = game:GetService("Players"):GetChildren()
	local Seeker = player.Name
	local PlayerCount = #Players - 1
	local Round = false
	local Status = "Blank"
		if hit.Parent:FindFirstChild("Humanoid") and Round == true then
			print("Player Hit")
			local Player = hit.Parent
			Player.Alive.Value = false
			Player.Humanoid.Health = 0


			PlayerCount -= 1
			print(PlayerCount.." Players Left")

			if PlayerCount == 1 then
				for i,v in pairs(Players) do
					if v.Alive.Value == true then
						Status = v.Name.." has won!"
	for i,v in pairs(Players) do
		local Spawns = game.Workspace.Spawns:GetChildren()
		local RandomSpawn = math.random(#Spawns)
		local SpawnLocation = Spawns[RandomSpawn]
		v.Character.HumanoidRootPart.CFrame = SpawnLocation.CFrame
		if v.Name == Seeker then
			v.Seeker.Value = true
			v.Character.Humanoid.WalkSpeed = 0
			v.Hider.Value = true
			v.Alive.Value = true
	for count = 5, 0, -1 do
		game.ReplicatedStorage.Timer.Value = count
	Status = "Seeker has been Released!"
	Round = true
	player.Character.Humanoid.WalkSpeed = 16

When the Seeker touches another player after the round has started, nothing happens. But oddly, it works when the seeker touches a Dummy/NPC, anybody know why?

Have you trie making it fire a RemoteEvent to the Server and then fire another one to the Client of the Player that has to die?

Not sure what you mean, this script is a server script

I’ve messed with this stuff a little in the past, have you at all experimented with Humanoid.Touched? It seems to be a little more reliable for stuff like this, but that was years ago. Worth investigating though!

Wait, from what I know the other Humanoid will not know he has to die unless you use a RemoteEvent if I’m not wrong

Why? This is inside a server script, that would only make sense if this was a local script. Not even sure how I would make a remoteevent work here.

That doesn’t seem to change anything.

Unfortunate, is it not firing the event period or is it just failing an if check?

Pretty sure it’s failing the if check. I added a print before the if statement and that works.

As you al can see I’m not a Progranmer so take every thgin with a grain of salt, I’m no expert, but why I mean is that because the Dummy doesn’t have a client and everything is accessible form the Server it can work, but maybe if it has a Client it doesn’t work?
You would implement the RemoteEvent just before you tell the Humanoid to die and then tell him to die fork another script?

1 Like

While this wasn’t directly the solution, you helped me realize there was another error in the script I didn’t catch. I forgot to use :GetPlayerFromCharacter when changing the value of alive

1 Like

Okay, yes sorry, I’m not a Programmer so I couldn’t really help :sweat_smile: , but I’m happy you were able to solve the problem! :smiley: