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

How To Script "Click To Type" SurfaceGUI?

Asked by 5 years ago

So I want to make a message board in my game where you can click the part and type what you want on there. I want what the players typed on there to stay even after you close the game. Basically it needs to stay until edited again. I've looked up videos on YouTube, but I can't find what I'm looking for. These are the objects inserted so far:

  • Part
    • SurfaceGUI
      • Frame
        • TextButton
          • Script
        • TextLabel

The script says:

script.Parent.MouseButton1Click:Connect:function()

end))

May someone please tell me if I've done something wrong and how to fix it and also what I need to add?

0
Search up datastore, or wait for someone to explain it for you. ^^ Or maybe watch this: https://www.youtube.com/watch?v=zBR0AmyF77M TheWaterFoox 255 — 5y
0
Data stores aren't required in that case. User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Instead of placing the SurfaceGui in workspace, place in the StarterGui, and set the Adornee to the part. And from a local script:

-- LocalScript

script.Parent.MouseButton1Click:Connect(function()
    -- code 
end)

Edit: The text will not change until new text is inputted.

Ad

Answer this question