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

How do you change the Name of a part using script?

Ok, so when a TextButton is pressed, I want this to execute: (This script is inside the TextButton)

script.Parent.MouseButton1Click:connect()
part = Instance.new("Part")
part.Name = SmokeButton
smoke = Instance.new("Smoke",game.Workspace.SmokeButton)
part.Position = -209.5, 15.5, 0.6

under part.Name = SmokeButton , there is a blue line under SmokeButton. Do I need to add an extra thing, like Enum with changing the Material?

2 comments

0

Part.Name = "SmokeButton" you need the 2 "" or ''

0

and in a text button you need a local script

1 answer

✓ Accepted answer

All I did was add "" - quotations.

Hope this resolves the issue.

script.Parent.MouseButton1Click:connect()
part = Instance.new("Part")
part.Name = "SmokeButton" -- use quotations 
smoke = Instance.new("Smoke", game.Workspace:WaitForChild("SmokeButton"))
part.Position = Vector3.new(-209.5, 15.5, 0.6)

2 comments

0

Well, you're right and not right. I've already found the answer; you just need to do what you did and you also need to add Vector3 on Line 5, thanks for the help!

0

Yes, sorry about that, don't know how I didn't see that. If you have the answer, please resolve it :v

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