Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Clickdetectors not working with parts/scripts?

Asked by
2mania 14
2 years ago

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

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 Jay123abc2 241 — 2y
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 raid6n 2196 — 2y

1 answer

Log in to vote
0
Answered by
boredlake 256 Moderation Voter
2 years ago

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
Ad

Answer this question