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..
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.
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)