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)
I do not really get what you mean by "capturing points" I understood it like that: You want transparency of Non and German 1 when its fully captured, We dont know what you want to do. I tried to help in a way I understood it, so I hope I understood it right:
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 script.Parent.Parent.American.Transparency = 0 for i = 0, 1, 0.1 do script.Parent.Parent.Non.Transparency = i script.Parent.Parent.German.Transparency = i wait(1) end 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 end else if player.Team ~= team then player.Character.Humanoid.Health = 0 end end end end)