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!!!
Here I Corrected Your Code. Comment If It Doesn't Work. I Edited It You Did Not Run The Function When The Person Clicks.
local Zombie = game.ReplicatedStorage:FindFirstChild("Zombie") local Attack = Zombie.AiScript local Humanoid = Zombie.Humanoid local Player = game.Players local Players = Player.LocalPlayer.Character local Clicker = Zombie.ClickDetector local function Attack() if Humanoid.Touched:Connect() then Player.Humanoid.Health = 0 else if Player.Humanoid.Health == 100 then --Your Other Function Here end end end local function Clicked() if Clicker.MouseButton1Down:Connect() then Zombie.Humanoid.Health = 0 else if Zombie.Humanoid.Health == 100 then --Your Other Code Piece Here I Guess end end end