Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get a script's original name?

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

3 comments

0

have a variable that keeps track of the scripts initial name

0

what do you mean by that?

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

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.