Syntax error and guiding beam feedback

i’m following the following tutorial :arrow_down: but was modifying it to enable/disable based on what gear the player has (trying to make a cooking system)

here are my questions:

  1. how do i fix the syntax error at line 21? Syntax Error: (21,10) Expected identifier when parsing variable name, got 'in'
  2. is my loop scripted correctly/efficiently? for some additional context, the gear name changes to “Buldak Ramen” after the player clicks a model that isn’t a parent of “BuldakSpark,” so i want to disable the beam after they finish the recipe
  3. if i wanted to make multiple beams for each step of the recipe, how would i add it to this script?
local Player = game.Players.LocalPlayer
local Char = Player.Character
local guide = game.Workspace["Cooking Kit (ramen test)"].Workspace.CookingSystem.Recipes


local function buldakGuidingArrow()
	for i,v in pairs(guide.BuldakRamenRecipe.BuldakSpark) do
		local beam = Instance.new("Beam")
		beam.Parent = v
		beam.Color = ColorSequence.new(Color3.fromRGB(0,0,0))

		local attachmentPlayer = Instance.new("Attachment")
		attachmentPlayer.Name = "guideToSeasoning"
		attachmentPlayer.Parent = Char:WaitForChild("HumanoidRootPart")

		beam.Attachment0 = v.Attachment
		beam.Attachment1 = attachmentPlayer
	end
end

for i,v, in pairs(Player.Backpack:GetChildren()) do
	if v.Name == "Plain Ramen" then
		buldakGuidingArrow() do
		end
	end
	
	if v.Name == "Buldak Ramen" then
		guide.BuldakSpark.Beam.Enabled = false
	
	end
end
1 Like

Look closely.

You misplaced a coma.

:melting_face:

1 Like

oh LOOOOOOOOOOOOOOOOOOOOOOOOOOL

beam still doesn’t appear with this script

1 Like

What with this?

Try this

beam.Attachment1 = Char:WaitForChild("HumanoidRootPart"):WaitForChild("RootAttachment")
1 Like

doesn’t work even when i remove the conditionals at the end

local Player = game.Players.LocalPlayer
local Char = Player.Character
local guide = game.Workspace["Cooking Kit (ramen test)"].Workspace.CookingSystem.Recipes


local function buldakGuidingArrow()
	for i,v in pairs(guide.BuldakRamenRecipe.BuldakSpark) do
		local beam = Instance.new("Beam")
		beam.Parent = v
		beam.Color = ColorSequence.new(Color3.fromRGB(0,0,0))
		beam.Attachment0 = v.Attachment
		beam.Attachment1 = Char:WaitForChild("HumanoidRootPart"):WaitForChild("RootAttachment")
	end
end
buldakGuidingArrow()

boosting cause i still have no solution and have been trying to tweak this for hours :melting_face: