Roblox keeps making my roblox Boolvalues the opposite

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)

1 Like

Please provide your script through \ “” \

I can’t read it like that

Put it like this:

*code*

How do i do that?
Im new by the way so i dont know

I’m gonna record a video. Be right back.

Then, with your code:

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)

Theres 2 scripts which can edit it and that steals it and theres a other which returns it

Nevermind i fixed it! Thank you for trying.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.