#gnome code depricationmaxxing

1 messages · Page 1 of 1 (latest)

fierce girder
#

some lines are mostly deprecated and idk how to fix, i tried to replace them with the undeprecated class but then it dosent work

fierce girder
#

nvm figured it out but now i got another problem

#

they also ignore pathfinding

fierce girder
#
local rs = game:GetService("ReplicatedStorage")
local ss = game:GetService("ServerStorage")

local ev = rs:WaitForChild("Events")
local spawntw = ev:WaitForChild("SpawnTower")
local animtw = ev:WaitForChild("AnimateTower")

local tw = {}

function findnt(ntw)
    local mdis = 50
    local nt = nil

    for i, t in ipairs(workspace.Mobs:GetChildren()) do
        local dis = (t.HumanoidRootPart.Position - ntw.HumanoidRootPart.Position).Magnitude
        if dis < mdis then
            nt = t
            mdis = dis
        end
    end

    return nt 
end

function tw.Attack(newtw)
    local t = findnt(newtw)
    if t and t:FindFirstChild("Humanoid") and t.Humanoid.Health > 0 then
-- this one 
        local targetPosition = t.HumanoidRootPart.Position
        local towerPosition = newtw.PrimaryPart.Position
        targetPosition = Vector3.new(targetPosition.X, towerPosition.Y, targetPosition.Z)
        newtw:PivotTo(CFrame.lookAt(towerPosition, targetPosition))
-- up to here        
        animtw:FireAllClients(newtw, "Hit")
        t.Humanoid:TakeDamage(1)
    end

    task.wait(1)
    
    tw.Attack(newtw)
end

function tw.Spawn(plr, n, cf)
    local tEx = rs.Towers:FindFirstChild(n)
    
    if tEx then
        local ntw = tEx:Clone()    
        ntw.HumanoidRootPart.CFrame = cf
        ntw.Parent = workspace.Towers
        ntw.HumanoidRootPart:SetNetworkOwner(nil)
        
        for _, object in ipairs(ntw:GetDescendants()) do
            if object:IsA("BasePart") then
                object.CollisionGroup = "Tower"
            end
        end
        
        coroutine.wrap(tw.Attack)(ntw)
    else
        warn("bro cant find:", n)
    end
end

spawntw.OnServerEvent:Connect(tw.Spawn)

return tw
fierce girder
wispy ginkgo
#

use

#

gnomecode for

#

tower defense

#

its old and outdated

#

too much deprecated functions and stuff

fierce girder
#

wth whered ur message go

wispy ginkgo
#

idk