Basically I'm scripting a tutorial level.
The "setBeam()" function just creates arrows for the player to follow.
As you complete a task, it will set the beam to the next part of the tutorial.
--...
--Variables that matters here
local interact = workspace:WaitForChild("Interact")
local tutorialParts = interact:WaitForChild("Items"):WaitForChild("TutorialParts")
--...
--Function that matters here
local function setBeam(player, enabled, level)
if level == 1 and enabled == true then
beam.Attachment0 = level1
elseif level ~= 1 and enabled == true then
print("test") --TEST ONE
for _, parts in tutorialParts:GetChildren() do
print("test1") --TEST TWO
if parts.Name == tostring(level) then
beam.Attachment0 = parts.Attachment
end
end
elseif enabled == false then
beam.Attachment0 = nil
end
end
the script works perfectly EXCEPT this line
for _, parts in tutorialParts:GetChildren() do
I have marked it with print("test") and print("test1") and only the first print actually prints.