#Server not being able to detect something in the backpack

1 messages · Page 1 of 1 (latest)

lean ingot
#

If the player is holding the tool, it will be inside the players character, not the backpack.

mortal jay
lean ingot
#

Are there any errors

mortal jay
#

there is not

hasty dock
#

Likely

#

Try to add print statements where you think the problem occurs

#

or everywhere

hasty dock
#

I dont think its able to find soil.

mortal jay
#

it just prints soil as nil

#

yeah

hasty dock
#

Yeah thats the problem

#

Soil isnt there

mortal jay
#

even though it does appear in the players inventory

#

er- backpack

hasty dock
#

What is Soil called?

#

"Soil"?

mortal jay
#

its called "Soil"

#

yeah

hasty dock
#

Does the event only happen once or does it not work at all?

mortal jay
#

it doesnt work at all

#

anything past "if not soil then return end"

#

doesnt work

hasty dock
#

Yeah because it cannot find soil

#

could you send me a video or such?

mortal jay
#

yes

hasty dock
#

It seems like it isnt a script problem but rather a problem with how your backpack is built and such

mortal jay
unique fractalBOT
#

studio** You are now Level 1! **studio

hasty dock
#

Alright

#

I may have the reason as to why it doesnt work

#

but im not 100% sure if its the right reason

#

The tool, do you clone it via a local script?

#

Or how do you insert it into the player?

mortal jay
#

i believe i do clone it via a local script

hasty dock
#

Yeah thats the problem

#

When you clone something with a local script, it only clones for that client

#

If you were to have 2 players, only the player that cloned that tool would be able to see it

#

the server wont see it either

#

My suggestion is to clone it via server

mortal jay
#

i see, thank you

hasty dock
#

-# and also, i dont reccommend scripts inside parts

#

-# keep them in serverscriptstorage and playerscripts

mortal jay
#

-# is there a reason why?

hasty dock
#

Optimization if im correct

#

And also its really annoying to handle them

mortal jay
#

yeah thats true

#

okay, i appreciate your help

hasty dock
#

Inserting scripts directly inside instances (like parts in the Workspace) is generally discouraged in Roblox development, primarily because it leads to disorganized, hard-to-maintain code and potential performance issues. While it technically works, it is considered bad practice compared to centralized management

#

Yeah so im correct happy

#

Any other questions I (hopefully) dont mind answering or helping with.

#

I can tell your a beginner, so make sure to take it slow lol

mortal jay
#

i do not have any other questions, and yeah i am a beginner, only been coding for a few months now

#

this is my first larger project

hasty dock
#

Is it a bad idea to say I might've taken less time than that..?

#

excluding that I also tried scripting in the past

#

Well good luck with your project, do remember that it takes time