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
"calling workspace" isn't correct terminology.
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
are the signs parts or click detectors? so is this the correct set-up: workspace --> buttons (folder) --> button1 (model) --> Eyesign (part) --> ClickDetector ?
The signs are parts and theres click detector in it