In the script, the script obtains a copy of the model to be regened, and then remove the model. The script is also supposed to detect if an outside variable is true or false, and the script will only work if the variable is false. However, the script is not working period, and I have no idea why, as output gave me nothing.
Can someone please help me?
Here's the script:
local Detect = script.Parent.Parent.Parent:WaitForChild("CoolDown")
local location = script.Parent.Parent.Parent
local regen = script.Parent.Parent
local save = regen:clone()
local CanClick = false
script.Parent.Parent.Heli:remove()
while wait do
if Detect.Value == false then
CanClick = true
elseif Detect.Value == true then
CanClick = false
script.Parent.BrickColor = BrickColor.new("Black")
end
wait(0.01)
end
function onClicked()
if CanClick == true then
regen:remove()
local back = save:clone()
back.Parent = location
back:MakeJoints()
Detect.Value = true
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

2 comments
It's still not working, and output is still not giving me anything to work with
Hmm, CanClick starts out as false. That might be the issue. Can you tell me if there's a script that changes Detect's value?