You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I would like the current script to be able to print objects stored in a folder which is stored in workspace. -
What is the issue? Include screenshots / videos if possible!
No errors are popping up. And the print statement isn’t printing anything. -
What solutions have you tried so far?
When I moved the script in workspace and make minor changes to code- for example the folder pathway- the print statement work. I would like the script to run in starterPlayerscripts.
I tried adding a player added event and that didn’t work. Is it possible to run this kind of script in starterPlayerscripts?
local game_workspace = game:GetService("Workspace")
local folder = game_workspace.Spawners
--local spawner_touched = {}
--[[
local function append_checkpoint(checkpoint)
local checker = false --means that the checkpoint isn't in the table
table.insert(spawner_touched,checkpoint)
return checker
end
--]]
--[[
local function is_humanoid()
local val = false
local player = script.Parent.Parent
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
if humanoid then
val = true
end
return val
end
--]]
--[[
local function touched_checkpoint(checkpoint)
if is_humanoid() and append_checkpoint() == false then
print("Part is touched:")
script.Parent.leaderstats.Obbylvl.Value = script.Parent.leaderstats.Obbylvl.Value + 1
end
end
--]]
for index, val in ipairs(folder:GetChildren()) do
print(val.Name)
end