My script:(I put it in a local script)
local Part = script.Parent Part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local PlayerName = hit.Parent.Name script.Parent.Parent.Parent.StarterGui.ScreenGui.TextLabel.Text = PlayerName end end)
wrong, this is a very common mistake which a lot of people edits screengui, yeah that works before but it's moved to playergui (located inside game.Players.LocalPlayer)
you are going to do:
local Part = script.Parent Part.Touched:Connect(function(hit) if hit.Parent.Name == game:GetService("Players").LocalPlayer.Name and hit.Parent:FindFirstChild("Humanoid") then local Character = hit.Parent -- Usually we get the character, not name local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui PlayerGui:WaitForChild("ScreenGui").TextLabel.Text = Character.Name end end)