How to make Poison Tower + How to make Defense System? | TUTORIAL | GnomeCode Tower Defense Addon

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 64

  • @iannaiopal2828
    @iannaiopal2828 9 месяцев назад +1

    is it possible that I could get some help? I got it all to work but I would like the poison damage to change depending on what's inside of the tower's config, but I'm not sure how to access the tower's config though the mob script.

    • @UndeadPerson12
      @UndeadPerson12 25 дней назад +1

      i think you could make a config named like PoisonDamage and then instead of making the poison damage a number do like = Tower.Config.PoisonDamage.Value

  • @hahafebruary14th
    @hahafebruary14th Год назад +2

    Is there a way you could make the poison damage ptoportional to the tower's damage? Like for example a tower does 15 damage, ans the poison also does 15 damage 7 times?

    • @Why-Just
      @Why-Just Год назад

      [sorry for late response] just change out the "1" for the tower's damage or you could make a DoT thingy in the towers config for a different damage [example: the first blow is 15 damage but the poison is 24]

    • @hahafebruary14th
      @hahafebruary14th Год назад

      ​@Why-Just [sorry for the later response 😭] I want it to do the tower's damage specifically though. Like if a tower does 15 damage and poisons an enemy, the enemy takes 15 damage 7 times. But then if another tower does 24 damage and hits the enemy, the enemy will take 24 damage 7 times if that makes sense

    • @Why-Just
      @Why-Just Год назад

      @@hahafebruary14th [oh hey look a response on time] maybe try making multiple types of "poison" with different damage values (example: fire, bleed, poison) and then having the respective towers use that type

    • @dyinexyi
      @dyinexyi 9 месяцев назад

      Create a new value then name it poisiondamage then if the tower shoots at it sets its damage to whatever damage yoh want

  • @MrMaximumGlorious
    @MrMaximumGlorious 5 месяцев назад +2

    anyone can help me evertime i place any towers it dont attack the zombie sometimes it only attack the first zombie then nothing i dont see problem of my script there no warning
    none i try make this idk whats problem anyone can help me pls

    • @ChickenKing_Ice
      @ChickenKing_Ice 5 месяцев назад

      I too have this problem and I've yet to figure out the problem

  • @meylanitrisiani210
    @meylanitrisiani210 Год назад +1

    can you make a video that shows how to make abilities on a zombie like, summon, stomp, or anything?

  • @thegamingproyo4417
    @thegamingproyo4417 Год назад +1

    can you make a tutorial on like when your placing a tower it has a key bind thing popup that follows the mouse like in TDS?

  • @SkilledIm
    @SkilledIm 6 месяцев назад

    is there anyway to make it so you can make it do more damage? Like when it is not upgraded it's deals like 10 damage every second but when it is upgraded it deals 25 every second

  • @delvanoelvin
    @delvanoelvin 7 месяцев назад

    I know I'm probably late for this to ask but the poison works but the mob kept getting poisoned. I even tried to place some particles for the visual effects but the particle works just fine, only the poison. And also the "IsPoison" Value is always set to true even if I tried to set it to false manually it will just change to true again. The "PoisonTime" Value just go to negatives and I copied your code in an exact same thing

  • @fabian_iraphahell7082
    @fabian_iraphahell7082 Год назад +1

    It did work good
    But if a summon enemy spawn its unit, it break complete until you place or upgrade again

  • @FlaminFish750
    @FlaminFish750 2 месяца назад

    I watched the stun video and know I have like 20 lines saved now

  • @jezzthedevofficial
    @jezzthedevofficial Год назад +2

    Damn deserves more traction and view gain. Just one question are you considering making like a dj or Commander type unit? Hope you get to 300!

    • @marat1980
      @marat1980  Год назад +2

      ruclips.net/video/FwME2D7tY7g/видео.html

    • @jezzthedevofficial
      @jezzthedevofficial Год назад +2

      @@marat1980 thx 🙏

    • @jezzthedevofficial
      @jezzthedevofficial Год назад +1

      Do u have plans to make skins too I’m just wondering it has someone made that or is it too complex?

  • @user-wf4gi3nv4c
    @user-wf4gi3nv4c Год назад +1

    Does mob aslo can have number value for defense? Because i want each of my enemies mob to hve each different defenses like one enemy with 5 defense

    • @RandumToys
      @RandumToys 10 месяцев назад

      yes that's literally what's already set up for you to do. 9 months later lol

  • @slay_queens727
    @slay_queens727 Год назад +5

    How to make a skin shop

  • @FlaminFish750
    @FlaminFish750 2 месяца назад

    I keep spelling poisoned, "posioned" so it slows me down

  • @genocidal439
    @genocidal439 Год назад +1

    Make one for like the gui where the next upgrade stats show up

  • @Krave12469
    @Krave12469 7 месяцев назад

    It Said "attempt to compare number

    • @Krave12469
      @Krave12469 7 месяцев назад

      Also I Have Problem That my Towwer Is Deal 2x Damage Instead of Poison Damage

  • @LohtyHD
    @LohtyHD Год назад +1

    i already did that 3 months ago the video its very late to date but the code its very weird it can be simplified with other method but yea it can be better

  • @nikolaskoppspring4961
    @nikolaskoppspring4961 Год назад

    It works but the other towers doest take damage to mob. But poison does damage to mob. Why and pls how to fix this

  • @doggersonmation4623
    @doggersonmation4623 Год назад

    i wrote everything right but it says that the enemy doesn't have the poison value, how do i fix that?

  • @felixou1059
    @felixou1059 Год назад +3

    the mobs not get the poison , can u help me to see what wrong, please help
    tower :
    local PhysicsService = game:GetService("PhysicsService")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local events = ReplicatedStorage:WaitForChild("Events")
    local animateTowerEvent = events:WaitForChild("AnimateTower")
    local functions = ReplicatedStorage:WaitForChild("Functions")
    local spawnTowerFunction = functions:WaitForChild("SpawnTower")
    local requestTowerFunction = functions:WaitForChild("RequestTower")
    local sellTowerFunction = functions:WaitForChild("SellTower")
    local changeModeFunction = functions:WaitForChild("ChangeTowerMode")
    local maxTowers = 8
    local tower = {}
    function tower.FindTarget(newTower, range, mode)
    local bestTarget = nil

    local bestWaypoint = nil
    local bestDistance = nil
    local bestHealth = nil
    local map = workspace.Map:FindFirstChildOfClass("Folder")

    for i, mob in ipairs(workspace.Mobs:GetChildren()) do
    local distanceToMob = (mob.HumanoidRootPart.Position - newTower.HumanoidRootPart.Position).Magnitude
    local distanceToWaypoint = (mob.HumanoidRootPart.Position - map.Waypoints[mob.MovingTo.Value].Position).Magnitude

    if distanceToMob = bestWaypoint then
    bestWaypoint = mob.MovingTo.Value

    if not bestDistance or distanceToWaypoint < bestDistance then
    bestDistance = distanceToWaypoint
    bestTarget = mob
    end
    end
    elseif mode == "Last" then
    if not bestWaypoint or mob.MovingTo.Value bestDistance then
    bestDistance = distanceToWaypoint
    bestTarget = mob
    end
    end
    elseif mode == "Strong" then
    if not bestHealth or mob.Humanoid.Health > bestHealth then
    bestHealth = mob.Humanoid.Health
    bestTarget = mob
    end
    elseif mode == "Weak" then
    if not bestHealth or mob.Humanoid.Health < bestHealth then
    bestHealth = mob.Humanoid.Health
    bestTarget = mob
    end
    end
    end
    end

    return bestTarget
    end
    function tower.Poison(newTower, target, duration)
    if not target then return end

    local statusEffects = target:FindFirstChild("StatusEffects")
    local targetHum = target:FindFirstChild("Humanoid")
    local isPoisoned = statusEffects:FindFirstChild("IsPoisoned")
    local poisonTime = statusEffects:FindFirstChild("PoisonTime")

    if not targetHum or not target then return end

    if statusEffects and poisonTime and duration >= poisonTime.Value then
    poisonTime.Value = duration
    end
    end
    function tower.Attack(newTower, player)
    local config = newTower.Config
    local target = tower.FindTarget(newTower, config.Range.Value, config.TargetMode.Value)

    if target and target:FindFirstChild("Humanoid") and target.Humanoid.Health > 0 then
    if config:FindFirstChild("PoisonTime") then
    tower.Poison(newTower, target, config.PoisonTime.Value)
    end
    local targetCFrame = CFrame.lookAt(newTower.HumanoidRootPart.Position, target.HumanoidRootPart.Position)
    newTower.HumanoidRootPart.BodyGyro.CFrame = targetCFrame

    animateTowerEvent:FireAllClients(newTower, "Attack", target)

    target.Humanoid:TakeDamage(config.Damage.Value)

    if target.Humanoid.Health

  • @alexthunder8226
    @alexthunder8226 Год назад +1

    2 videos inside in a video how

  • @VKingCraft
    @VKingCraft Год назад +2

    Oh god finallyyyyy

  • @FrostedOven
    @FrostedOven Год назад +1

    you're soo underated

  • @Explosion_of_show-Dima
    @Explosion_of_show-Dima Год назад +2

    Очень полезное видео! Вы можете сделать так чтобы к примеру башня лучника стреляла стрелой в зомби или снежкометчик кидал снежок в зомби и тд?

    • @Sir_Lemons
      @Sir_Lemons Год назад

      When you animate your tower attack animation, make sure the part or projectile that you want to animate is not welded to the Handle but is a joint. To do so you need a plugin. I forgot what the name was but just search up “how to animate shooting in roblox” sadly you need moon animator

  • @imaz0mbie_
    @imaz0mbie_ Год назад +1

    burst towers cant attack hiddens

  • @MiniatureGamingX
    @MiniatureGamingX Год назад +1

    works thanks bro

  • @mrjunkmg
    @mrjunkmg Год назад

    it doesn't work :(

  • @alexthunder8226
    @alexthunder8226 Год назад +1

    make a code tutorial please

  • @Rayz_zell
    @Rayz_zell 6 месяцев назад

    3:52

  • @Kylofunplayz567
    @Kylofunplayz567 8 месяцев назад

    why is the text russian?

  • @PIXEL137
    @PIXEL137 Год назад

    It doesnt work for me idk why

    • @Jonasfc20
      @Jonasfc20 Год назад

      Same it just makes my monsters stuck in the start

  • @blacksharkroblox5
    @blacksharkroblox5 5 месяцев назад

    2:04

  • @_syuri7676
    @_syuri7676 Год назад +1

    how to make flame damage?

  • @ЭсмирМукашев-ь3п
    @ЭсмирМукашев-ь3п Год назад +1

    Харош ❤😊😮😢🎉

  • @robotwinter9224
    @robotwinter9224 Год назад +1

    Спасибо тебе ты лучший

  • @maksimgeims
    @maksimgeims Год назад +2

    Это круто :D

  • @133thegamer2
    @133thegamer2 Год назад +1

    Nice

  • @andromeda4884
    @andromeda4884 2 месяца назад

    doesn't work, don't try it

  • @Safashifin
    @Safashifin 4 месяца назад

    thanks

  • @Error.4082
    @Error.4082 Год назад

    anyone have the scripts

  • @PaintballerGamer
    @PaintballerGamer Год назад +1

    2 in 1 no way

  • @Explosion_of_show-Dima
    @Explosion_of_show-Dima Год назад +1

    Ответе мне

  • @FightersDefender
    @FightersDefender Год назад +1

    this tutorial is scam! 😡