#I'm making a tower defense game, please help me

1 messages ยท Page 1 of 1 (latest)

wraith axle
#

As you saw in the video, I added a script to my zombie mob script that plays the animation manually? I added an animation and the mob hasn't moved since. Can anyone fix this? If possible, I can also send you a picture of the script details

#

local Wave = 0 --์›จ์ด๋ธŒ
local WaveTime = 60 --์›จ์ด๋ธŒ๋‹น ์‹œ๊ฐ„

local CastleHealth = game.Workspace.Castle:WaitForChild("Health") --์„ฑ ์ฒด๋ ฅ ๋ฐธ๋ฅ˜ ๋กœ๋”ฉํ•˜๊ธฐ

local Waves = game.ReplicatedStorage:WaitForChild("Waves") --์›จ์ด๋ธŒ ๋ชฌ์Šคํ„ฐ ์„ค์ •ํ•œ๊ฑฐ
local Mobs = game.ReplicatedStorage:WaitForChild("Mobs") --๋ชฌ์Šคํ„ฐ ๋„ฃ์–ด๋‘” ํด๋”
local WayPart = game.Workspace:WaitForChild("WayPart") --๋ชฌ์Šคํ„ฐ๊ฐ€ ์ง€๋‚˜๊ฐˆ ๊ธธ ์„ค์ •ํ•œ๊ฑฐ ์›จ์ดํŒŒํŠธ

local RemoteEvent = game.ReplicatedStorage:WaitForChild("GuiEvent") --๋ฆฌ๋ชจํŠธ ์ด๋ฒคํŠธ

local function MobSpawn(MobValue) --๋ชน์„ ์Šคํฐํ•˜๋Š” ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค MobSpawn
local Mob = Mobs:FindFirstChild(MobValue.Name) --ํ•ด๋‹น ๋ชน ์ฐพ๊ธฐ

local Clone = Mob:Clone() --๋ชน ๋ณต์‚ฌ
Clone.Parent = game.Workspace.SpawnMobs --๋ณต์‚ฌํ•œ ๋ชน ์›Œํฌ์ŠคํŽ˜์ด์Šค๋กœ ์ด๋™
Clone:MoveTo(WayPart.Start.Position) --์Šคํƒ€ํŠธ ํŒŒํŠธ๋กœ ๋ณต์‚ฌํ•œ ํ…”๋ ˆํฌํŠธ


for i, part in pairs(Clone:GetChildren()) do
    if part:IsA("BasePart") then
        part:SetNetworkOwner(nil)
    end
end

local Humanoid = Clone:FindFirstChild("mob") --๋ชน์˜ ํœด๋จธ๋…ธ์ด๋“œ
local Finish = #WayPart:GetChildren() - 1


local Animator = Humanoid:FindFirstChild("Animator")
local Animation = Animator:LoadAnimation(Clone.Animation)
Animation:Play()



for i = 1, #WayPart:GetChildren() do --์›จ์ดํŒŒํŠธ ์ˆ˜ ๋งŒํผ ๋ฐ˜๋ณต
    if i == Finish then --์›จ์ดํŒŒํŠธ๊ฐ€ ํ”ผ๋‹ˆ์‰ฌ ํŒŒํŠธ๋งŒ ๋‚จ์•˜๋‹ค๋ฉด
        Humanoid:MoveTo(WayPart.Finish.Position) --ํ”ผ๋‹ˆ์‰ฌ ํŒŒํŠธ๋กœ ๋ชน ์ด๋™
        --Model:MoveTo(ํฌ์ง€์…˜)์„ ํ•˜๋ฉด ๋ฐ”๋กœ ๋ชจ๋ธ์ด ์ด๋™๋˜์ง€๋งŒ Model.Humanoid:MoveTo(ํฌ์ง€์…˜)์ฒ˜๋Ÿผ ํœด๋จธ๋…ธ์ด๋“œ๋ฅผ MoveToํ•˜๋ฉด ๊ฑท๊ธฐ ๋ชจ์…˜์ด ์‹คํ–‰๋œ๋‹ค

        Humanoid.MoveToFinished:Wait() --์ด๋™์ด ๋๋‚  ๋•Œ๊นŒ์ง€ ๋Œ€๊ธฐ
        CastleHealth.Value = CastleHealth.Value - Clone:FindFirstChild("Damage").Value --๋ชน์— ์žˆ๋Š” ๋Œ€๋ฏธ์ง€ ๋ฐธ๋ฅ˜ ๋งŒํผ ์„ฑ ์ฒด๋ ฅ ์ฐจ๊ฐ

        Clone:Destroy() --๋ชน ์‚ญ์ œ (์„ฑ์— ๋„๋‹ฌํ–ˆ์œผ๋‹ˆ ์‚ญ์ œ)
        break
    else --๋งˆ์ง€๋ง‰ ํŒŒํŠธ๊ฐ€ ์•„๋‹ˆ๋ผ๋ฉด
        Humanoid:MoveTo(WayPart[i].Position) --๋‹ค์Œ ์›จ์ดํŒŒํŠธ๋กœ ์ด๋™
        Humanoid.MoveToFinished:Wait() --์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๋๋‚  ๋•Œ๊นŒ์ง€ ๋Œ€๊ธฐ
    end
end

end

local function Main(Set) --MobSpawn๋“ฑ์„ ์‹คํ–‰์‹œํ‚ค๋Š” ๋ฉ”์ธ ํ•จ์ˆ˜
local SetChildren = Set:GetChildren() --์›จ์ด๋ธŒ ํด๋” ์•ˆ์— ์žˆ๋Š”๊ฑฐ ์ „๋ถ€ ๊ตฌํ•˜๊ธฐ (๋ช‡๊ฐœ์˜ ๋ชฌ์Šคํ„ฐ๋ฅผ ๋‚ด๋ณด๋‚ผ์ง€ ์„ค์ •ํ•œ ๋ฐธ๋ฅ˜๊ฐ’๋“ค)

#

for i = 1, #SetChildren do --๊ตฌํ•œ ํด๋” ์•ˆ์— ๋ฐธ๋ฅ˜ ์ˆ˜ ๋งŒํผ '๋ฐ˜๋ณต'
local MobValue = SetChildren[i] --๊ทธ ์ค‘์— ํ•˜๋‚˜์˜ ๋ฐธ๋ฅ˜ (์ˆœ์„œ๋Œ€๋กœ ๊ตฌํ•จ)

    for i = 1, MobValue.Value do --๋˜ ๊ทธ ๋ฐธ๋ฅ˜์˜ ๊ฐ’๋งŒํผ ๋ฐ˜๋ณต (5๋ฅผ ์ ์—ˆ๋‹ค๋ฉด ๋‹ค์„ฏ ๋ฒˆ ๋ฐ˜๋ณต)
        spawn(function() --๋˜ ํ•˜๋‚˜์˜ ์Šค๋ ˆ๋“œ์—์„œ ์‹คํ–‰. ๋ฉ”์ธ ์Šค๋ ˆ๋“œ๋ฅผ ์ง€์—ฐ์‹œํ‚ค์ง€ ์•Š์Œ
            MobSpawn(MobValue) --๋ชน ์Šคํฐ ํ•จ์ˆ˜ ์‹คํ–‰
        end)

        wait(1) --1์ดˆ ๋งŒํผ ๊ธฐ๋‹ค๋ฆฌ๊ธฐ (๋ชน์˜ ์Šคํฐ ๊ฐ„๊ฒฉ)
    end
end

end

wait(5) --5์ดˆ ๊ธฐ๋‹ค๋ฆฌ๊ธฐ

while true do --๊ณ„์† ๋ฐ˜๋ณต
Wave = Wave + 1 --1 ์›จ์ด๋ธŒ ๋”ํ•˜๊ธฐ
local FindWave = Waves:FindFirstChild(Wave) --์›จ์ด๋ธŒ์— ํ•ด๋‹น๋˜๋Š” ๋ชฌ์Šคํ„ฐ ์„ค์ • ์ฐพ๊ธฐ FindWave
RemoteEvent:FireAllClients(Wave) --๋ฆฌ๋ชจํŠธ ์ด๋ฒคํŠธ๋กœ ๋ช‡ ์›จ์ด๋ธŒ์ธ์ง€ ๋ณด๋‚ด๊ธฐ

if FindWave then --์›จ์ด๋ธŒ ๋ชฌ์Šคํ„ฐ ์„ค์ •์ด ์กด์žฌํ•  ๋•Œ
    Main(FindWave) --๋ฉ”์ธ ํ•จ์ˆ˜
else --ํ•ด๋‹น ์›จ์ด๋ธŒ์˜ ๋ชฌ์Šคํ„ฐ ์„ค์ •์ด ์—†์„ ๋•Œ
    print("์›จ์ด๋ธŒ ์ข…๋ฃŒ") --'์›จ์ด๋ธŒ ์ข…๋ฃŒ'๋ฅผ ์ถœ๋ ฅ์ฐฝ์— ๋ณด๋ƒ„
    break --๋ฐ˜๋ณต๋ฌธ ์ข…๋ฃŒ
end

wait(WaveTime) --WaveTime๋งŒํผ ๊ธฐ๋‹ค๋ฆฌ๊ธฐ

end

#

It's a script. Please ignore Korean

#

If you want, I can also show you what's inside the zombie, or if you can come to my map and help me out, it's better

#

local Animator = Humanoid:FindFirstChild("Animator")
local Animation = Animator:LoadAnimation(Clone.Animation)
Animation:Play()

wraith axle
ocean dust
#

chinese ah comments

wraith axle
#

bro

#

wdym

prisma moss
#

did you try using a different ai to generate this?

wraith axle
#

I'm reporting a video of a YouTuber and I don't think it's going to be connected to another script other than this one

west doveBOT
#

studio** You are now Level 1! **studio

prisma moss
#

did you try following a different tutorial?

wraith axle
#

Since I'm Korean, I can only do tutorials that were made by Koreans

#

I can use the translator, but it's too much trouble

#

Isn't that script good now?

prisma moss
#

did you try learning how to code and writing it yourself instead of copying someone else's work?

#

i mean if you write it yourself, you'll understand how it works and that'll solve your problem? Thumbs

#

if you don't earn it, you won't learn it.

bitter spindle
#

ai wont get you anywhere

#

itll fuck your ass up and then dont know what did wrong too

#

non-sentient

wraith axle
#

Oh, it's moving now, but the animation isn't working

wraith axle