How to make a place down barrier

Hello recently I made a game and a staff barrier. But I want to know how you script it so you can place 20 barriers down.

  • Max 20 Barriers
  • Able to place down multiple barriers
  • Able to, Delete all barriers, Place Down Barrier.

If you could help this would be great!

Barrier:
image

Place Barrier:
image

2 Likes

Well, we aren’t exactly going to spoonfeed code, but you can do it something like this:

local max = 20
local barriers = 0

This essentially sets up the initial varaibles.

local max = 20
local barriers = 0

tool.Activated:Connect(function()
   if barriers < max then
      barriers = barriers + 1
      -- Do code to clone it and position it.
   end
end)
1 Like

When I put the tool for the team it doesn’t pop up!

1 Like

Can we see your current script?

1 Like

You don’t put the tools in the team. You need to script it so it gives it to the people on certain teams. You can do this with PlayerAdded and Player.Team.

1 Like