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

why doesnt think work?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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?

0
Obviously you have your hierarchy incorrect. woodengop 1134 — 8y

1 answer

Log in to vote
0
Answered by
wackem 50
8 years ago

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!

Ad

Answer this question