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

why doesnt think work?

Im tryingt o make a yandere simulator game but I need this script to work here is what I did

  1. I made a part

2.I put a script in the part

script= function onClick()
	game.Startergui.ScreenGui.Textbutton.Visible = true
end
script.Parent.MouseButton1Click:connect(onClick)

3.inserted the textbutton in screengui and screen gui in startergui

when i do this and i click the part in the output it says "mousebutton1down is not a valid member of part" what does that mean?

1 comment

0

Obviously you have your hierarchy incorrect.

1 answer

✓ Accepted answer

You first must insert a ClickDetector into the part, and then it is:

local part = script.Parent
local clickd = part:WaitForChild("ClickDetector")

clickd.MouseClick:connect(function()
game.StarterGui.ScreenGui.TextButton.Visible = true
end)

Hope it helps!

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