Press player to get there username in to the text ui

  1. What do you want to achieve? Press player’s character to get there username.

  2. What is the issue? Pressing the character but can not change the text.

  3. What solutions have you tried so far? Yes but no solutions found.

local player = game.Players.LocalPlayer
local button = script.Parent.TextButton
local Username_Frame = script.Parent.AssignFrame.Username
local PlayerUsername = player.Name
local mouse = player:GetMouse()

mouse.Button1Down:Connect(function()
	local target = mouse.Target
	if target.Parent:FindFirstChild("Humanoid") and target.Parent ~= game.Workspace then
		Username_Frame.Text = player.Name
	end
end)

Video of issue.

https://gyazo.com/1f589efdeaa6baf4978c2a0aab055b53

Try creating a clone of your character and trying it on that, I don’t believe you can select yourself.
Also, you are setting the text to your own Local Player’s name

1 Like

What should I do about here. (30c)

Well you want to make it the name of the target, so target.Parent.Name

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.