Zombies breaking barricades and being able to repair them

I’ve been trying to make a zombie walk up to a barricade, break it, and go through it but also be able to repair them for points if someone can help it would be appreciated, I’ve looked up videos and can’t find anything

3 Likes

For breaking the barricade you could use a .Touched event in the barricade and an if statement to check if the touching part is a zombie part and when a player walks near put up a proximity prompt if it is broken

right ima try it tmr thx appreciate it

I made a simple less then 10 mins example code you can edit it

--ZOMBIE
local Debounce = false
local Delayer = 1

Zombie.HumanoidRootPart.Touched:Connect(function(Hit)
	local Finder = Hit.Parent:FindFirstChild("BarricadeMAINPART")--If you want
	
	if Hit.Name == "Barricade" then -- YOU CAN CHANGE THIS TO WHAT you want
		
		if Debounce == false then--Time for attacking
			Debounce = true
			
			-- if you got decal change transparency
			Hit.CanColide = false
			Hit.Tranparency = 0
			Hit.Name = "Broken"
			
			wait(Delayer) --- after waits attacks again
			Debounce = false
		end
		
		
	end
end)

--PLAYER

--You can you clickdetector or whatever 
Idontknow(function()
	Hit.CanColide = true
	Hit.Tranparency = 1
	Hit.Name = "Barricade"
end)

Also use a if

if Hit.Name == "Broken" then
      FIX IT
end
1 Like

@skybird_99 man your a god appreciate it

1 Like

thanks No Problem i like helping don’t forget to click solved so others could find the solution for there game

1 Like