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

Why doesn't the tool name change?

function NameChange()
	wait(1)
	script.Parent.Name = "DOPE"
end

What is wrong with this script and how can i fix it?

1 comment

1

well first off, have you called the function?

2 answers

✓ Accepted answer

You must call the function.

local tool = script.Parent

function nameChange(newName) -- Otherwise the function is pointless
	tool.Name = tostring(newName) -- In case only a number value is submitted
end

nameChange('Dope')

You have to execute the function

function NameChange()
    wait(1)
    script.Parent.Name = "DOPE"
end

NameChange()

Also, this doesn't change the script's name. It changes its parent's name.

1 comment

0

He isn't trying to change the script's name...

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