Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

When all models clicked doesn't transparent the door?

script.Parent.MouseClick:Connect(function()
	game.workspace.Eyessign.Eyessign2.Eyessign3.Eyessign4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)
	script.Parent.Parent.Parent.ENDDOORTHETRUTH.Cancollide = true
	script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
	wait(25)
end)

Above this is the script, So i have a folder and if they click to the parts those "Eyessigns" the ENDDOORTHETRUTH will be transparent. But not works, I have clickdetector but still not works anything..

2 answers

SPELLING

The problem I see immediately is that "CanCollide" has a lower case "c" in your above code, so it should be written as:

script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true

Secondly, when calling game.Workspace you can use workspace or game.Workspace, but not game.workspace as the workspace itself is capitalized

game.Workspace.Eyessign.Eyessign2.Eyessign3.Eyessign4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)

OR

workspace.Eyessign.Eyessign2.Eyessign3.Eyessign4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)

FUNCTION LIMITS

The next cause for concern I see, is that you need to make sure the script is parented under the clickdetector, based on the beginning of the function.

Next, you have two mouseclick detections, but only one function is complete (the second one) If the clickdetector you are using is the script.Parent then the function should be:

script.Parent.MouseClick:Connect(function()
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
    wait(25)
end)

Otherwise the function should be:

workspace.Eyessign.Eyessign2.Eyessign3.Eyessign4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
    wait(25)
end)

In relation to this issue, you said "when a model is clicked", meaning the clickdetector should be under the model (first example), unless its under the following parentage (second example): game --> Workspace --> Eyessign --> Eyessign2 --> Eyessign3 --> Eyessign4 --> Eyessign4 --> ClickDetector

EXPLOITATION

I would also add a debounce since you are waiting for 25 seconds:

local debounce = true

script.Parent.MouseClick:Connect(function()
if debounce == false then return end
debounce = false
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
    wait(25)
debounce = true
end)

OR

local debounce = true

workspace.Eyessign.Eyessign2.Eyessign3.Eyessign4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)
if debounce == false then return end
debounce = false
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
    wait(25)
debounce = true
end)

EDIT:

local debounce = true

function Detect(player)
	if debounce == false then return end
	debounce = false
	script.Parent.Parent.Parent.ENDDOORTHETRUTH.CanCollide = true
	script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
	wait(25)
	debounce = true
end

workspace.Buttons.Button.Eyessign.ClickDetector.MouseClick:Connect(Detect)
workspace.Buttons.Button2.Eyessign2.ClickDetector.MouseClick:Connect(Detect)
workspace.Buttons.Button3.Eyessign3.ClickDetector.MouseClick:Connect(Detect)
workspace.Buttons.Button4.Eyessign4.ClickDetector.MouseClick:Connect(Detect)
workspace.Buttons.Button5.Eyessign5.ClickDetector.MouseClick:Connect(Detect)

Your attempted functions do not have any event inside them so they will not do anything. Since the "Eyesign"s are parts and the Click Detectors are under these, you are not using a valid property of a Part and thus need to add the ClickDetector to the end of the connection.

4 comments

0

"calling workspace" isn't correct terminology.

0

There's a folder named "Buttons" and the signs are in a model in the folder models named "Button1 Button2 Button3 Button4 Button5". and there's the signs in the models and the models in the folder

0

are the signs parts or click detectors? so is this the correct set-up: workspace --> buttons (folder) --> button1 (model) --> Eyesign (part) --> ClickDetector ?

0

The signs are parts and theres click detector in it

There's a folder named "Buttons" and the signs are in a model in the folder models named "Button1 Button2 Button3 Button4 Button5". and there's the signs in the models and the models in the folder, and I tried this:

local debounce = true

game.workspace.Buttons.Button.Eyessign.MouseClick:Connect(function(PlayerWhoClicked)
end)
game.workspace.Buttons.Button2.Eyessign2.MouseClick:Connect(function(PlayerWhoClicked)
	
end)
game.workspace.Buttons.Button3.Eyessign3.MouseClick:Connect(function(PlayerWhoClicked)
	
end)
game.workspace.Buttons.Button4.Eyessign4.MouseClick:Connect(function(PlayerWhoClicked)
	
	game.workspace.Buttons.Button5.Eyessign5.MouseClick:Connect(function(PlayerWhoClicked)
end)
    if debounce == false then return end
    debounce = false
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Cancollide = true
    script.Parent.Parent.Parent.ENDDOORTHETRUTH.Transparency = 1
    wait(25)
    debounce = true
end)

3 comments

0

Still not works man

0

made a slight mistake, it should work now, unless "ENDDOORTHETRUTH" is a model and/or you re-named the ClickDetectors

0

I didnt renamed the clickdetectors and the "ENDDOORTHETRUTH" is a union

This discussion is preserved as it was. New answers, comments, and votes are closed.