How to find out who placed an object

hello, so im making this plugin thing and im wondering how I could see who placed an object. Is there even a way to do this? Any help is appreciated.

How are players placing objects?

its a plugin. not people placing inside the game. So inside studio . I’d like to know a way to detect who placed an object inside studio.

When the player creates a part, create a StringValue | Roblox Creator Documentation inside of it, and set the string to the player’s name. And that way, when the part’s owner needs to be checked, check the string inside to find out who owns it.

I said its for studio. Not a placement system. I wanna see who placed an object inside studio

oh my bad… didnt read ur last post

In like a plugin, you can maybe make a button that when clicked, get’s the userID of the user. That’s the closest thing I can think of to what you want.

Make a plugin that you require all of the developers to have that does this inside of studio. It pretty much just checks for each instance added and adds a value to it with their name in it.

1 Like

Exactly what I said.

A script for this:

workspace.DescendantAdded:Connect(function(obj)
    Instance.new("StringValue", obj).Value = game:GetService("StudioService"):GetUserID()
end)

That’s not the exact function but I am really just too lazy to research it.

Adding on to this (note there might be a better way), I’d recommend looking into the Selection service. The solution above checks all new objects, even if the player didn’t create the object. What you could do is check when a new descendant is added, then check if that descendant is being selected by the user (which I believe is always the case when a user adds an object).

You may need to wait a second for the Instance to be added to the user’s selection though, I’m not certain.

1 Like

that’s a good idea. Idk why i didn’t think of that! thx for the suggestion.

2 Likes

I don’t see the point.

If one member of team create adds an object, on each of their studio clients an object is added. This means every one of them would be marked as the creator of the object, instead of just the single player who created it.

To fix this, the code can check when an object is added, then check if the user is selecting the object when it’s created. Only the user who created the object will be (in theory) selecting the object when it’s created.

1 Like

Oh ok. Sorry about that haha.

1 Like