local function AddToNoobs() if script.Parent.Parent.Parent.Parent.Parent.Noob.Noobs.Value <= 25 then game.StarterGui.ScreenGui.TextLabel.Visible = true wait(5) game.StarterGui.ScreenGui.TextLabel.Visible = false else script.Parent.Parent.Parent.Parent.Parent.Noob.Noobs.Value = script.Parent.Parent.Parent.Parent.Parent.Noob.Noobs.Value + 1 end end script.Parent.MouseButton1Click:Connect(AddToNoobs)
As I said, no errors appear, the main part that I believe is not working is the statement to make the TextLabel visible, as everything else in the script works. My script can't be local due to the fact that I need to edit the leaderstats.
startergui is used by the server to replicate a gui for every player that joins. When working with gui, reference game.Players.LocalPlayer.PlayerGui
for example:
game.StarterGui.ScreenGui.TextLabel.Visible = true
would be
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Visible = true
Remember to use a localscript while working with client replicated stuff such as guis. If you need to use something serversided, use a remote event. for remotes go here:
https://developer.roblox.com/articles/Remote-Functions-and-Events