Hey Guys, So I Make Tower Defense like Game But i have some problem with my zombies!.
As you can see on client side it work perfectly, the zombie are walking and taking base damage, but
This Is Server Side, The Zombie Wont Walk, This makes harder how the tower should shoot them
this is the zombie script, sorry i was not an expert scripter, maybe messy
local ts = game:GetService("TweenService")
local Human = script.Parent:WaitForChild("Humanoid")
local done = false
script.Parent:GetPropertyChangedSignal("Parent"):Connect(function()
--local RunningAnim = Human:LoadAnimation(script.RunAnim)
--RunningAnim:Play()
local speed = .1
local distance1 = (script.Parent.Parent.spawn.Position - script.Parent.Parent.j1.Position).Magnitude
local distance2 = (script.Parent.Parent.j1.Position - script.Parent.Parent.j2.Position).Magnitude
local distance3 = (script.Parent.Parent.j2.Position - script.Parent.Parent.j3.Position).Magnitude
local distance4 = (script.Parent.Parent.j3.Position - script.Parent.Parent.lose.Position).Magnitude
local anim1 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(speed * distance1,Enum.EasingStyle.Linear),{Position = script.Parent.Parent.j1.Position})
local anim2 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(speed * distance2,Enum.EasingStyle.Linear),{Position = script.Parent.Parent.j2.Position})
local anim3 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(speed * distance3,Enum.EasingStyle.Linear),{Position = script.Parent.Parent.j3.Position})
local anim4 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(speed * distance4,Enum.EasingStyle.Linear),{Position = script.Parent.Parent.lose.Position})
local or1 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(.2,Enum.EasingStyle.Linear),{Orientation = Vector3.new(0,90,0)})
local or2 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(.2,Enum.EasingStyle.Linear),{Orientation = Vector3.new(0,0,0)})
local or3 = ts:Create(script.Parent.HumanoidRootPart,TweenInfo.new(.2,Enum.EasingStyle.Linear),{Orientation = Vector3.new(0,-90,0)})
anim1:Play()
anim1.Completed:Connect(function(pb)
if pb == Enum.PlaybackState.Completed and not done then
or1:Play()
wait(.1)
anim2:Play()
end
end)
anim2.Completed:Connect(function(pb)
if pb == Enum.PlaybackState.Completed and not done then
or2:Play()
wait(.1)
anim3:Play()
end
end)
anim3.Completed:Connect(function(pb)
if pb == Enum.PlaybackState.Completed and not done then
or3:Play()
wait(.1)
anim4:Play()
end
end)
anim4.Completed:Connect(function(pb)
if pb == Enum.PlaybackState.Completed and not done then
script.Parent.Parent.hitsfx:Play()
script.Parent.Parent.basehp.Value -= script.Parent.Hp.Value
script.Parent:Destroy()
end
end)
health()
end)
function health()
while wait(1) do
if script.Parent.Humanoid.Health < 1 then
script.Parent:Destroy()
end
end
end
Update: Its Working On Server Side But Only The Torso ? [HumanoidRootPart]