✓ Accepted answer
This happened because when the Click Detector is activated, it does not send the name of the player who activated it, but its data, it sends the player in full.
So when you use FindFirstChild, you get this error because it cannot search for it in Workspace, because we are not talking about a name, but an entire entity.
You just need to enter the following code.
script.Parent.ClickDetector.MouseClick:Connect(function(CharacterName)
local Character = workspace:FindFirstChild(tostring(CharacterName))
end)
Note: CharacterName is the player, not your name!
Thus, the code will convert the entire entity into just one name, which is the name of the entity, hence the name of the player.
You can also do the following.
script.Parent.ClickDetector.MouseClick:Connect(function(CharacterName)
local Character = workspace:FindFirstChild(CharacterName.Name)
local Character = CharacterName.Character
end)
In short, everything.
CharacterName = Player
CharacterName ~= Player.Name
Hope this helps.
If you have any questions, you can ask me.
:)