so ive been getting an error saying: (Ignore The Brackets) (attempt to index nil with 'FindFirstChild')
the full error:
(17:11:57.662 - Players.Rgboffical_yt.PlayerGui.ScreenGui.Frame.Blue.LocalScript:2: attempt to index nil with 'FindFirstChild')
the portion of the code:
local tools = game.ServerStorage:findFirstChild("DataStoreFolder") local SpeedCoil = tools:FindFirstChild("Ak-47") print("Done!!!!!!!!!!!")
so how do i fix it please help!!! ThankYou!!!
Okay, so just by the error message I can see that this is a Local Script. The reason why this doesn't work is because ServerStorage can only be accessed by the Server, same goes with ServerScriptService. Local Scripts are client-sided and therefore cannot access ServerStorage. Local Scripts can access ReplicatedStorage though, so you could move the folder there instead.
Most likely because "DataStoreFolder" doesn't exist whenlocal tools = game.ServerStorage:findFirstChild("DataStoreFolder")
ran, so tools would be nil
Try using WaitForChild instead
local tools = game.ServerStorage:WaitForChild("DataStoreFolder")