Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to get author that created a script?

Asked by 5 years ago
Edited 5 years ago

I understand this is confusing, let me explain and what its purpose is. This is my first plugin, it fills out all information in the script I may need. Credits to the author ect. I need to get the author who created the script, and who changed it. Heres a piece of my code.

workspace.ChildAdded:Connect(function(child)
    if child:IsA("Script") then
        local script = child
        local table = os.date("*t")
        local message = string.format(table.wday)
        print(message)
        script.Source = "--[[ {Credits} \n Author: .... \n Date of Creation:" ..string.format(table.month/table.day/table.year)"\n Last Change:..."
    end
end)

What are we doing here? We are detecting when a script is added into the workspace. Im really stumped on how I would get the author of the script, the person that created it. We need to do the same thing when the source is changed. Find out who changed it

Thanks in advance. (My first question ;)

0
dude the author is the owner of the game are u sped? fistter1 88 — 5y
0
Maybe you should read the question before you rage. Skippy_Development 59 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Try using the GetStudioUserId function combined with the GetNameFromUserIdAsnyc function.

GetStudioUserId: https://developer.roblox.com/en-us/api-reference/function/Plugin/GetStudioUserId GetNameFromUserIdAsnyc https://developer.roblox.com/en-us/api-reference/function/Players/GetNameFromUserIdAsync

For finding out who changed it you would have to Change the text in the Client of the Person that changes it. That requires everyone in your Team to have the Plugin.

0
Thanks so much, I think im going to drop the change and just use who created the script. Skippy_Development 59 — 5y
Ad

Answer this question