Obvisouly you are new to Lua. Welcome to scripting helpers. Firstly, if you are making the screen GUI inside StarterGui, why find it in workspace?
Log = script.Parent
Tree = game.Workspace.Tree
Log.ClickDetector.MouseClick:connect(function()
scr = Instance.new ("ScreenGui", game.StarterGui)
txt = Instance.new ("TextLabel",scr)
txt.Text = ("Timber")
wait(0.032)
end)
Secondly if you do that, you are changing the StarterGui not the PlayerGui so it won't update for the player.
Log = script.Parent
Tree = game.Workspace.Tree
Log.ClickDetector.MouseClick:connect(function()
local scr = Instance.new ("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local txt = Instance.new ("TextLabel",scr)
txt.Text = ("Timber")
txt.Size = UDim2.new(0,100,0,100)
txt.Position= UDim2.new(0.5,0,0.5,0)
wait(0.032)
end)
Finally, we need to make the gui destroy itself after a time.
Log = script.Parent
Tree = game.Workspace.Tree
Log.ClickDetector.MouseClick:connect(function()
local scr = Instance.new ("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local txt = Instance.new ("TextLabel",scr)
txt.Text = ("Timber")
txt.Size = UDim2.new(0,100,0,100)
txt.Position= UDim2.new(0.5,0,0.5,0)
wait(3)
scr:Destroy()
end)
Firstly, make sure that the script's parent (inside) the log. Also make sure there is a click detector inside the log. Then make sure the script is a local script. You are done!
1 comment
You do realize you're parenting the TextLabel to StarterGui and not Workspace right?