Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make the ice cloud do more damage the longer a target is in it?

Asked by 3 years ago
            if part and part.Parent then
                local Hum,FF = part.Parent:FindFirstChildOfClass("Humanoid"),part.Parent:FindFirstChildOfClass("ForceField")
                if Hum and not IsInTable(Hums,Hum) and Hum.Health ~= 0 and not FF and not IsTeamMate(Creator.Value,Services.Players:GetPlayerFromCharacter(Hum.Parent)) then
                    Hums[#Hums+1] = Hum
                    local player = Services.Players:GetPlayerFromCharacter(part.Parent)
                    if (player) then
                        continue -- We continue instead of returning because it's in a loop and we just ignore the players in the Region3 instead of just stopping the loop
                    end
                    Hums[#Hums+1] = Hum
                    Hum:TakeDamage((7))
                    Hum.WalkSpeed = math.clamp(Hum.WalkSpeed - (16/(60*2)),3,16) -- Progressive Slowdown
                    if Hum.Health <= 0 or GetHumanoidTime(RecHumanoids,Hum) >= 20 then --Freeze them when they have no walkspeed or health left
                        local function Frozen(Character) -- Quick check to see if they're not frozen
                            for _,v in pairs(Services.ServerScriptService:GetChildren()) do
                                if v:IsA("Script") and v.Name == "Freeze" and v:FindFirstChild("Target") and v:FindFirstChild("Target").Value == Hum.Parent then
                                    return true
                                end
                            end

this is a script for staff of neverending frost and I want to make it so if an NPC stays in the cloud they'll take more damage the longer they're in it

Answer this question