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

Game doesn't expand territory on kill?

Asked by 3 years ago

Everything goes fine and works till this part

(code only shows lines that are important)

local MaxTerrirory = 20
local RedTerritory,BlueTerritory = MaxTerrirory/2,MaxTerrirory/2
local MaxSize = 200

local MainZone = GroundZones:WaitForChild("MainArea")
local RedZone = GroundZones:WaitForChild("RedZone")
local BlueZone = GroundZones:WaitForChild("BlueZone")

local StartSize1,StartSize2,StartCFrame1,StartCFrame2

local function Lerp(S,E,A)
    return S + (E-S)*A
end

local function RecalculateZoneSizesByScores(Alpha)
    local Center = MainZone.CFrame
    local RedOff,BlueOff = (RedTerritory/MaxTerrirory) * MaxSize,(BlueTerritory/MaxTerrirory) * MaxSize
    RedZone.Size = StartSize1:lerp(Vector3.new(RedOff,1,60),Alpha)
    BlueZone.Size = StartSize2:lerp(Vector3.new(BlueOff,1,60),Alpha)
    RedZone.CFrame = StartCFrame1:lerp(Center * CFrame.new((MaxSize - RedOff)/2,0,0),Alpha)
    BlueZone.CFrame = StartCFrame2:lerp(Center * CFrame.new(-(MaxSize - BlueOff)/2,0,0),Alpha)

end

I tried using prints and it does try to recalculate but changes nothing for whatever reason also no errors get logged

Answer this question