How do i script a Team Door like:
Only Red Team can go inside of the Red Team base
Only Blue Team can go inside of the Blue Team base
Anyone help pls for my new game called “Blox Minigames”
How do i script a Team Door like:
Only Red Team can go inside of the Red Team base
Only Blue Team can go inside of the Blue Team base
Anyone help pls for my new game called “Blox Minigames”
local Players = game:GetService("Players")
local door = game.Workspace.Door
local debounce = false
door.Touched:Connect(function(hit)
if not debounce then
debounce = true
if hit then
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player and player.TeamColor == BrickColor.new("Bright red") then --You can change bright red to your desired team color
door.Transparency = 0.5
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
end
end
wait(0.5)
debounce = false
end
end)
Here it is.
A server script, inside the door, or in serverscriptservice
If you put the script inside the door, you can write, instead of local door = game.Workspace.Door,
you can use local door = script.parent
Np.If this worked, mark my answer as the solution.(Also, this is made for a Bright Red team)