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

Clickdetectors not working with parts/scripts?

So I have been making games for a while and I was making a find the button game and after you find the button there will be a popup that says you completed it but the script seems to not work is this a new studio update? Script: ~~~~~~~~~~~~~~~~~ local frame = script.Parent.Parent.Parent.StarterGui.levels.level1

local part = script.Parent

part.ClickDetector.MouseClick:Connect(function() frame.Visible = true end)


2 comments

0

Is the script a local script, as I dont know if they work like that. Also, is it a gui? Clickdetectors only work in a physical part of the game, such as a part [Models not included]. If using a gui, it will be a button and mousebutton1click

0

… Elsa? … Do you wanna build a snowman? Come on let's go and play I never see you any more Come out the door It's like you've gone away! We used to be best buddies And now we're not I wish you would tell me why Do you wanna build a snowman? It doesn't have to be a snowman (Go away, Anna!) Okay, bye … Do you wanna build a snowman? Or ride our bike around the halls? I think some company is overdue I

1 answer

If you're having problems trying to get the GUI to show, it should be a LocalScript inside of StarterGui and the variables of the LocalScript should be defined as follows:

local frame = script.Parent.levels.Level1
local part = workspace.Part -- reference the part here wherever it is in your workspace

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