So i was experiment to make team only healing script, but turns out it didn't work. And it doesn't show any error, so i was wondering if i did anything wrong. (here's the code) while true do
for i, v in pairs(game.Teams["Vampire"]:GetPlayers()) do
local v = part.Parent:findFirstChild("Humanoid")
if v~=nil then
v.Health = v.Health + 2
end
wait(1)
end
for 1, you are not looping it, the for only goes over every player once and 2, im not sure you can change v without it returning the original v later
local team = "Vampires" local health = 2 local delay = 1 while true do for k,v in pairs(game.Players:GetPlayers()) do if v.Team = game.Teams[team] then local h = v.Character:FindFirstChildOfClass("Humanoid") if not h then return nil end h.Health = h.Health + health end end wait(delay) end