#I'm making a tower defense game, please help me
1 messages ยท Page 1 of 1 (latest)
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()
When I added this, it suddenly stopped moving
chinese ah comments
did you try using a different ai to generate this?
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
** You are now Level 1! **
did you try following a different tutorial?
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?
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? 
if you don't earn it, you won't learn it.
ai wont get you anywhere
itll fuck your ass up and then dont know what did wrong too
non-sentient
Oh, it's moving now, but the animation isn't working