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

Question, how would i make it so this script make the player see a gui or textlabel within a gui?

Asked by 6 years ago

Hello, my name is chronofantastic and i'd like to ask how would i make it so a player sees a gui or textlabel within the gui? Here is my short code, please dont be rude to me or unkind.

local gui = game.Players.LocalPlayer.PlayerGui

gui = game:GetService("Players").LocalPlayer.PlayerGui

gui.Info1.SecA.Visible = true

I know it isnt much, but please dont be mean to me as this is my first question asked.

0
Don't worry, we won't be mean. :) Pixelated_MC 33 — 6y
0
Where is this script located? Is it in the player, or in the Workspace? I need to know that to be able to respond. Pixelated_MC 33 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Hello! Thanks for joining the community.

To do what you are asking, simply use a Hint, which is small text box GUI that appears at the top of the screen:

function showMessage(player, text, duration)
    game.Players:WaitForChild(player)
    local hint = Instance.new("Hint")
    game.Players[player]:WaitForChild("PlayerGui")
    hint.Parent = game.Players[player].PlayerGui
    hint.Text = text
    wait(duration)
    hint:Destroy()
end

Usage:

showMessage("ChronoFantastic", "Congrats on your first question!", 5)
0
If you want a ScreenGui instead, I can show that way too. Just tell me and I will edit this answer. But this is way simpler! Pixelated_MC 33 — 6y
0
Hint’s are deprecated. User#19524 175 — 6y
0
Not sure but I think he wants to show specific already created gui with some text, idk Amiaa16 3227 — 6y
0
^ Yes, its true what kiriot22 just said. User#22722 20 — 6y
View all comments (3 more)
0
Its also in the workspace. User#22722 20 — 6y
0
I didnt mean a hint, but it works, so its accepted! User#22722 20 — 6y
0
Thanks! Pixelated_MC 33 — 6y
Ad

Answer this question