I stehre away i could make a way so who clicked this object happens to them i dotn know how that works like i want it to be if a player name carl12345 touches it and the script does not have to have a name like game.workspace. then the name i want it to be random like minecraft you can do this give {name} dirt 1 in a command block
If you want to tell who clicked some object, you can use a ClickDetector inside of the object and connect to its MouseClick event which returns the player who clicked as a parameter.
1 | Part.ClickDetector.MouseClick:connect( function (player) |
2 |
3 |
4 | end ) |
If you wanted to get the player from someone who touched something then it would be through a Touched event:
1 | Part.Touched:connect( function (hit) |
2 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
3 | if not player then return end |
4 |
5 |
6 | end ) |
Ok thanks I was young when I posted this I understand what you meant thanks 1waffle1