here is my script:
local Zombie = game.ReplicatedStorage:FindFirstChild("Zombie")
local Attack = Zombie.AiScript local Humanoid = Zombie.Humanoid
local Player = game.Players local Players = Player.LocalPlayer
local Clicker = Zombie.ClickDetector
local function Attack() if Humanoid.Touched:Connect() then Player.Humanoid.Health = 0 elseif Player.Humanoid.Health == 100 end end
local function Attack()
local function Clicked(function() if Clicker.MouseButton1Down:Connect() Zombie.Humanoid.Health = 0 elseif Zombie.Humanoid.Health = 100 end)
local function Clicked()
it says: 14:13:07.961 - Workspace.Zombie.AiScript:18: Expected 'then' when parsing if statement, got 'end'
...Pls Help!!!

8 comments
Alright. So it seems to work, until I tried to click the zombie to kill it...It didn't do anything...
Oh
yeah... :/
I'm thinking os using a break joint function, but I'm not too sure how to use it...
Take A look At The Dev Forum It Will Help You https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseClick
Aight! Thank you very much for your help!
Your Welcome You Can Contact Me At Lua#8082 Any Time On Discord If You Need Help For Future Scripts.
ok :)