Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ServerStorage tools won't work from inside ReplicatedStorage?

Asked by 8 years ago

I've had this problem for awhile ago:

In my game, I have multiple GUI's inside of the ReplicatedStorage that are enabled, and when trying to get tools from the ServerStorage, it only works inside of Studio. I have to have a second set of tools inside the ReplicatedStorage in order for them to work normally in the game.

Here is the script: (it's a normal script, but before if I wanted this to work, it had to be a LocalScript, and I had to have a second copy of tools inside of ReplicatedStorage and it would take it from there, but I want to remove the need for this)

for i,c in pairs(script.Parent:GetChildren()) do
if c:IsA("ImageButton") then
c.MouseButton1Click:connect(function()
p = script.Parent.Parent.Parent.Parent.Parent
wait(0.25)
for _,v in pairs(p.Character:GetChildren()) do
if v:IsA("Tool") and v.Name~='AlbedosOVOmnitrix' then
v:Destroy()
end end
for _,v in pairs(game.ServerStorage.GameTools[c.Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
if p:FindFirstChild'Backpack' then
v:clone().Parent = p.Backpack
end end end end) end end

What is going on?

Help would be very much appreciated. I hate having to have two sets of tools just for this to work.

SOME of the stuff on my GUI works, and other tools won't load at all, which makes zero sense.

To those that maybe seeing it in action might help, use any of the tools with Omnitrix in them and try being some of the characters in the GUI. Very few give tools, but the scripting is the same..

https://www.roblox.com/games/232129654/LuckyAuras-Place-Number-109

0
Please edit your answer with a code block. It's the blue button that says Lua. Put you're code inside the lines after clicking the button while editing your answer. It's nearly impossible for me to read what you have written without a code block. User#11440 120 — 8y
0
Sorry about that, I just joined the site! LuckyAura -1 — 8y
1
I don't believe localscripts can access ServerStorage. Nickoakz 231 — 8y
1
ServerStorage is only ment for server scripts to be able to access. It's a perfect solution to not replicate what the client doesn't need in ServerStorage. Nickoakz 231 — 8y

Answer this question