Hello Helpers so it says in the output TextLabel is not a valid member of Workspace and I put
Log = script.Parent Tree = game.Workspace.Tree script.Parent.mouseClick:connect(function() Instance.new ("ScreenGui", game.StarterGui) Instance.new ("TextLabel", game.StarterGui) game.Workspace.TextLabel.Text = ("Timber") wait(0.032) end)
please help me i am a middle scripting
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) -- Textlabel goes inside the ScreenGui so you can see it txt.Text = ("Timber") -- Update the text. 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) -- Textlabel goes inside the ScreenGui so you can see it txt.Text = ("Timber") -- Update the text. txt.Size = UDim2.new(0,100,0,100) -- Size of the text label. txt.Position= UDim2.new(0.5,0,0.5,0) -- Position of the text label. 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) -- Textlabel goes inside the ScreenGui so you can see it txt.Text = ("Timber") -- Update the text. txt.Size = UDim2.new(0,100,0,100) -- Size of the text label. txt.Position= UDim2.new(0.5,0,0.5,0) -- Position of the text label. wait(3) scr:Destroy() -- Destroy the screengui! 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!
The way your coding is set up gives me the impression that your new to scripting so go watch a few tutorials. Is the scripts parent a ClickDetector otherwise this event won't work.
Log = script.Parent Tree = game.Workspace.Tree script.Parent.MouseClick:connect(function() scr = Instance.new ("ScreenGui", game.StarterGui) txt = Instance.new ("TextLabel",scr) txt.Text = ("Timber") wait(0.032) end)