local script:
local player = game.Players.LocalPlayer
player.Chatted:Connect(function(msg)
if msg:lower():match("killall") then
game:GetService("ReplicatedStorage"):WaitForChild("killall"):FireServer()
end
end)
server script:
local killall = remote:WaitForChild("killall")
local players = game.Workspace:GetChildren()
killall.OnServerEvent:Connect(function()
for i, v in pairs(players) do
if v:FindFirstChild("Humanoid") then
v.Humanoid.Health = 0
print(v.Name)
print(v.Humanoid.Health)
end
end
end)
output: klepolek version 3
0
MR. Pirana
0
baldi
0
but i didnt die, why when the others die(they are npc's with a humanoid inside of them)

3 comments
first the server script cant look into the local players and second off in my code it found the "players" in the workspace and put their humanoid.health to 0, all but mine so from just reading this i can tell it wont work but mine should work
... Why would you ask for help, then refuse it? His script does work. and it can look at the local player he just didint put it in as a parameter.
Scripts can look into players by using a simple loop. What I'm doing is looping through the table of players, getting their character, and then afterwards changing their humanoid to zero. You're insufferable lmao