Hello, i am making a “capture” the flag game with some twists but i am fed up with this annoying roblox bug where if you have a boolvalue and try to disable it it will just either stay enabled or if you try to enable it it stays disabled.
Script:
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
local TweenService = game:GetService(“TweenService”)
local time = 0.8
if player.Team.Name == “Blue Team” then
local tween = TweenService:Create( player.PlayerGui.Notifcations.TextLabel,TweenInfo.new(time), {TextTransparency = 1})
if script.Parent.Parent.Takenable.Value == true then
player.Character.Flags.HasRed.Value = true
script.Parent.Parent.Takenable.Value = false
script.Parent.ActionText = "Stolen by "…player.Name
print(“taken a flag real”)
player.PlayerGui.Notifcations.TextLabel.TextTransparency = 0
script.Parent.Parent.Stolen:Play()
player.PlayerGui.Notifcations.TextLabel.Text = “stolen red’s flag!”
wait (0.7)
tween:Play()
else
print(“no”)
end
end
end)
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
local TweenService = game:GetService(“TweenService”)
local time = 0.8
if player.Team.Name == “Blue Team” then
local tween = TweenService:Create( player.PlayerGui.Notifcations.TextLabel,TweenInfo.new(time), {TextTransparency = 1})
if script.Parent.Parent.Takenable.Value == true then
player.Character.Flags.HasRed.Value = true
script.Parent.Parent.Takenable.Value = false
script.Parent.ActionText = "Stolen by "…player.Name
print(“taken a flag real”)
player.PlayerGui.Notifcations.TextLabel.TextTransparency = 0
script.Parent.Parent.Stolen:Play()
player.PlayerGui.Notifcations.TextLabel.Text = “stolen red’s flag!”
wait (0.7)
tween:Play()
else
print(“no”)
end
end
end)
Alright, now answering your question:
But before answering, can you tell me where, in this script, is the problem?
Did you get any error message? And are you sure another script isn’t changing the values?
Also i formatted the script
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
local TweenService = game:GetService(“TweenService”)
local time = 0.8
if player.Team.Name == “Blue Team” then
local tween = TweenService:Create( player.PlayerGui.Notifcations.TextLabel,TweenInfo.new(time), {TextTransparency = 1})
if script.Parent.Parent.Takenable.Value == true then
player.Character.Flags.HasRed.Value = truechanging?
script.Parent.Parent.Takenable.Value = false
script.Parent.ActionText = "Stolen by "…player.Name
print(“taken a flag real”)
player.PlayerGui.Notifcations.TextLabel.TextTransparency = 0
script.Parent.Parent.Stolen:Play()
player.PlayerGui.Notifcations.TextLabel.Text = “stolen red’s flag!”
wait (0.7)
tween:Play()
else
print(“no”)
end
end
end)