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

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

Asked by 6 years ago

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?

0
Part.Name = "SmokeButton" you need the 2 "" or '' therealae 7 — 6y
0
and in a text button you need a local script therealae 7 — 6y

1 answer

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

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)
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! CaptaiinNoob 52 — 6y
0
Yes, sorry about that, don't know how I didn't see that. If you have the answer, please resolve it :v StoleYourClothes 105 — 6y
Ad

Answer this question