#Button not working if i play the game for too long

1 messages · Page 1 of 1 (latest)

daring apex
#

When i test it like "play here" and press the button it works. but if i go from the beginning and play the game untill that button, the button dosent work: heres the script

#

local model = script.Parent

local button = model:FindFirstChild("RedButton")
local redtext = model:FindFirstChild("Red")
local door = model:FindFirstChild("Door")
local DelClickDetector = model.RedButton:FindFirstChild("ClickDetector")

local PressSound = model:FindFirstChild("PressSound")
local EndSound = model:FindFirstChild("EndSound")
local TalkingMan = model:FindFirstChild("TalkingMan")

local clicked = false

local function click()
if clicked then return end
clicked = true

if PressSound then 
    PressSound:Play()
end
if redtext then
    redtext.Transparency = 0
end
task.wait(0.7)
if TalkingMan then
    TalkingMan:Play()
end
task.wait(1) --how many secs man and +1
if EndSound then
    EndSound:Play()
end
if door then
    door:Destroy()
end
if DelClickDetector then
    DelClickDetector:Destroy()
end

end

button.ClickDetector.MouseClick:Connect(click)

grave kestrel
#

It should work fine

#

There's no error in 'this' script.

#

Maybe tell us about other scripts dealing with this button model

daring apex
gritty abyss
#

@daring apex try adding print statement under each if statement and code below - to debug it fully

daring apex
#

i think the click detector isnt working after some time but i see the clickdetector in explorer

#

@gritty abyss

gritty abyss
#

Add print above if clicked yhen return rnd and lmk

daring apex
#

@gritty abyss only prints that

gritty abyss
#

Well yeah then click detector is broken - check whenever you are actually clikcing on it

daring apex
#

hmmm okay

#

what should i do

frozen cedar
#

memory leaks ig

daring apex
#

maybe

celest idol
#

nevermind what i said

daring apex
#

np

gritty abyss
#

Are you using cas anywhere