I made a script where when you press U, it damages one of the dummies. However, the problem is that it only damages one dummy and not any other. How do I fix this script?
The script:
local commandTest = game.Workspace.CommandTestDummies:FindFirstChild("KillTest")
local userInput = game:GetService("UserInputService")
local human = commandTest:FindFirstChild("Humanoid")
userInput.InputBegan:Connect(function(inputBegan, gameProccesed)
if inputBegan.KeyCode == Enum.KeyCode.U then
if human ~= nil then
human.Health = human.Health - 25
end
end
end)
