Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ClickDetector non existent when playing online?

Asked by
Cuvette 246 Moderation Voter
8 years ago

Hey, so my script places a GUI on a wall that someone has placed down once clicked on in case they would like to destroy it or they've misplaced it. Everything goes to plan and works fine when i'm playing in studio, but what it comes to playing online, the console says the ClickDetector does not exist in the part?

enabled = 1

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
    if enabled == 1 then
    if script.Parent.Parent.Parent.Parent.Name == (playerWhoClicked.Name.."'s House") then
        local Gui = game.Lighting.DestroyBlock
        Gui:Clone().Parent=script.Parent
        wait(0.5)
        enabled = 0
    end
    else if enabled == 0 then
        script.Parent.DestroyBlock:Destroy()
        wait(0.5)
        enabled = 1
        end
    end 
end)
0
Make sure your hierarchy is correct. Perhaps you put the script inside the ClickDetector? Perci1 4988 — 8y
0
Try :WaitForChild() and make sure the Archivable property is set to true theCJarmy7 1293 — 8y

Answer this question