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

Why do I have a Crafting Error? (SOLVED)

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)

7 comments

0

What IS the error?

0

It underlines "PRODUCTNAME" in blue

0

Blue underline isn't an error, check your output for errors.

0

Please tell me what I should do :( . I didn't see any "errors" but the script was highlighting the word in blue...

0

I'm completely lost :(

0

Open up Script Analysis and see what it says about the blue.

0

Put "local" before PRODCTNAME, and the blue should go away.

1 answer

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

1 comment

0

Thanks a lot :)

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