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

How do I get a script's original name?

Asked by 5 years ago

Let's say, somebody enters a script and the script's name is changed, how do I get the script's original name?

0
have a variable that keeps track of the scripts initial name royaltoe 5144 — 5y
0
what do you mean by that? ViviTheLuaKing 103 — 5y
0
at the beginning of the script have a variable that contains the scripts original name. either can do name = "YourNameHere" or name = script.Parent.Name royaltoe 5144 — 5y

1 answer

Log in to vote
0
Answered by
kom297 -4
5 years ago

Let's just say the script changes when a part is touched so do this to keep track of the name

local scriptName = "script name here"
script.Parent.Touched:Connect(function()
    script.Name = "heyy"
end)
Ad

Answer this question