#This doesnt work im gonna go insane

1 messages · Page 1 of 1 (latest)

molten thicket
#

output doesnt print anything

#

The other tags work

languid vessel
#

u gotta wait

#

the script is local which is run in client side

#

and client do not load everything instantly

molten thicket
#

but it works with other tags

languid vessel
#

it also has to do with streaming service

languid vessel
#

try to add task.wait()

molten thicket
#

alr

#

thanks man

molten thicket
#

well i try to use game.isloaded but it doesnt work

#

and adding task.wait in the start of the script feels like a bad habit

languid vessel
#

so when an object load

#

it fire the signal

#
local CollectionService = game:GetService("CollectionService")

local function block_added(block)
  ... -- pretend code here
end

for i, block in CollectionService:GetTagged("Block") do 
  block_added(block) 
end

CollectionService:GetInstanceAddedSignal("Block"):Connect(block_added) -- block added 
languid vessel
#

it'll work like you expected but without using task.wait()