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

Why do I have a Crafting Error? (SOLVED)

Asked by 9 years ago

What do I to change the shape, color, and size?(Just to be sure) (The main question-->) Why do I get an error on line 5?

script.Parent.Touched:connect(function(Part)
   if Part.Name=="PARTNAME" then
      Part:remove()
      script.Parent:remove()
      PRODUCTNAME=Instance.new("Part", game.Workspace)
      --Adjust shape/color/size of product item here.
   end
end)

0
What IS the error? AmericanStripes 610 — 9y
0
It underlines "PRODUCTNAME" in blue Seeker5123 15 — 9y
0
Blue underline isn't an error, check your output for errors. Perci1 4988 — 9y
0
Please tell me what I should do :( . I didn't see any "errors" but the script was highlighting the word in blue... Seeker5123 15 — 9y
View all comments (3 more)
0
I'm completely lost :( Seeker5123 15 — 9y
0
Open up Script Analysis and see what it says about the blue. Perci1 4988 — 9y
0
Put "local" before PRODCTNAME, and the blue should go away. dyler3 1510 — 9y

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

What's happening isn't an error. It underlines that in blue because it's suggesting that you change it to a local variable. Just put "local" and a space before it if you want it to go away. like this:

local PRODUCTNAME=Instance.new("Part", game.Workspace)

For more about variables/local variables check out this page.

Hope I helped :P

0
Thanks a lot :) Seeker5123 15 — 9y
Ad

Answer this question