Basically when you say the string nearby players get damaged .
Im not getting any error but the script doesn’t seem to be working.note this is a normal script inside serverscriptservice .
local Players = game:GetService('Players')
local db = false
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Player.Chatted:Connect(function(msg)
local c = Player.Character
if msg == "stridor" and not db then
local db = true
for i,v in pairs(workspace:GetChildren()) do
if v:findFirstChild("HumanoidRootPart") and v:findFirstChild("Humanoid") == nil and v ~= c then
if (v.HumanoidRootPart.Position - c.HumanoidRootPart.Position).magnitude < 15 then print("Ho")
v.Humanoid:TakeDamage(5)
wait(14)
local db = false
end
end
end
end
end)
end)
end)
I would like to know what i’m doing wrong so i can fix it