I'm making an activation tycoon, but the activation is irrelevant for this question.
local dp = script.Parent:FindFirstChild("DropPart")
local b = script.Parent:FindFirstChild("Button")
print("1st print")
local debounce = false
if b and dp then
print("First IF")
local c = b:FindFirstChild("ClickDetector")
if c.MouseClick and debounce == false then
debounce = true
print("Debounce")
b.BrickColor = BrickColor.Red()
local p = Instance.new("Part")
print("Creating part")
p.CFrame = dp.CFrame
p.Size = Vector3.new(1,1,1)
print("Set size and postition")
p.Parent = script.Parent:FindFirstChild("PartStorage")
wait(5)
b.BrickColor = BrickColor.Green()
print("Set Brick Color")
wait(5)
p:Destroy()
print("Destroyed Part")
end
end
I've checked the hierachy and everything is fine. When I click the button, nothing happens.

1 comment
Also if you're wondering i'm adding the whole cash part later