Why won't this work

script:


workspace:
image

2 Likes

Module scripts don’t work in workspace

also instead of using:

workspace:FindFirstChild("Part") == true

do this:

workspace:FindFirstChild("Part")

ok thxs let me try it and tell you if it works

it didn’t help and it don’t work

It’s not a solution it’s just more optimized way of saying FindFirstChild(“Part”), Just change the Cookie modulescript to script and it will work.
image

no i am not using the modulescript i am using local script
image

this is the cookie module script

What do you get when you print something inside the repeat loop?

huh can you explain more i can’t understand what you mean


you mean a debug like this?

image
it can’t detect if i clicked it for not

Print something inside the repeat loop

repeat
    if workspace:FindFirstChild("Part") then
    print("smth")
    ....

yo it worked i was doing

 if workspace:FindFirstChild("Part") == true then

but when i changed it to it worked

 if workspace:FindFirstChild("Part") then

2 Likes

yes, that’s because FindFirstChild returns an Instance, not true or false. When you do if <something> then, that’s the same as writing if <something> == true or <something> ~= nil then.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.