Hello, I've been working on a game and the main gameplay is to capture flag points but the problem is that you capture the point instantly without needing to wait. I was wondering how I can modify the script I have.
Thanks.
Other Info:
The script is a normal script inside model inside workspace
Script:
local team = game.Teams["US Armed Forces"]
local open = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not open then
if player.Team == team then
script.Parent.CanCollide = false
for i = 1, 8 do
script.Parent.Parent.American.Transparency = 0
script.Parent.Parent.Non.Transparency = 1
script.Parent.Parent.German.Transparency = 1
script.Parent.Parent.PointTextPart.B.Enabled = true
script.Parent.Parent.PointTextPart.N.Enabled = false
script.Parent.Parent.PointTextPart.G.Enabled = false
game.Workspace.APoint.Value = 1
wait(2)
end
end
else
if player.Team ~= team then
player.Character.Humanoid.Health = 0
end
end
end
end)

2 comments
can you explain it further? Do you want the player to touch the part and get points or overtime they get points?
Well for example battlefield 1. In the game when your on a capture point you have too defend the point before it has been captured by your team.