local ShopGuiThing = script.Parent
local ServerStorage = game:GetService("ServerStorage")
local ServerScriptStorage = game:GetService("ServerScriptService")
local Frame = ShopGuiThing.Frame
local Container =Frame.ShopMain.ScrollingContainer
local ItemTemplate = script.Template
local ToolsFolder= ServerScriptStorage:FindFirstChild("Tools")
local toolConfig = ToolsFolder:FindFirstChild("ToolConfig")
well. I am trying to require a module script from another modulescript letâs call it moduleScript2. ModuleScript2 is in a ScreenQui maybe this is a problem? ıdk
you can check the script locations or script types from explorer tap
As long as the script that started the chain of modulescripts requiring eachother is a local script, then all of them will run on the client, thus cannot access server storage.
so⊠to fix it what I have to do? if it possible I want to keep my moduleScript in ServerStorage But İf I put it the ModuleScript 2 in the serverscript how to I make it effect a PlayerGui⊠Man scripting is really hard
I can? I mean I should be able to do it because Ä°f I canât put it to serverStorage or ServerScriptStorage then the game will be vulnerable against exploiters
Putting a ModuleScript to Replicated storage is really a bad idea
The client canât run code it doesnât have, if you want the player to run code you have to give it to them. This has no effect on exploiters.
You only have to keep code hidden from the client that does âbusiness logicâ, basically anything that affects other players. Everything else should be done on the client.
no it is not? exploiters can see what is inside the Replicated storage so if I put the moduleScript inside the ReplicatedStorage then they can Acces Tool names,Prices etc. but if I make it with a fire event they will only see the What happens after FireClient happens So they will just know the name of module script where it is located but not the valuables inside the module script
Variables are in the code? You are giving them the code? This would actually be less secure because roblox replicates only the bytecode (no comments), while just sending the code over will include the comments (unless you filter them out of course but that would be unnecessary extra work).
Your code is for showing items in a shop, the client must know the names, prices and etc. to be able to display them in the ui.
Like everyone is saying, ItemHandler that is in the Gui, canât access the ServerScriptStorage because it is a client script.
The obvious solution is to put the ToolsFolder in Replicated Storage, BUT donât put ItemHandler in Replicated Storage because scripts canât run in there.
Maybe something like this:
local ShopGuiThing = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Frame = ShopGuiThing.Frame
local Container = Frame.ShopMain.ScrollingContainer
local ItemTemplate = script.Template
local ToolsFolder = ReplicatedStorage:FindFirstChild("Tools")
local toolConfig = ToolsFolder:FindFirstChild("ToolConfig")
The client canât acces the server storage.
Also use instead WaitForChild() is a local script, then I think that the problem is that when you use FindFirstChild, the frame has not got time enough to appear/load. Frame:WaitForChild("Tools")