Hey, I’m currently trying to make a gui that appears on the click of a part. I have the gui ready in a ScreenGui, I have the part with a click detector. And that click detector has a script parented to it. But, when I click on the part, I get an error in the output saying:
[Workspace.Part.ClickDetector.Script:8: attempt to index function with ‘Clone’]
This is the code
local clickDetector = workspace.Part.ClickDetector
clickDetector.MaxActivationDistance = 10
local SCI = script.SCI
function SCI(player)
if player.PlayerGui:FindFirstChild("SCI") == nil then
local sciClone = SCI:Clone()
sciClone.Parent = player.PlayerGui
else
end
end
clickDetector.MouseClick:Connect(SCI)
And this is the layout in the workspace

Any help or something to point me in the right direction is appreciated.
Thanks.