So today i’ve tried experimenting a little bit with tables and tried a very simple crafting system.
Everything worked fine exept when i tried making the viewport frame for the object that is going to be crafted. I choose a way to store the Model and camera for the viewport frame using replicated storage where i put these two in a folder and then stored the paths to the in a table.
The problem is that the script cannot find the camera, but can find the Model even though they’re in the same folder and when i hit run the camera is still there.
Maybe it is, becuase i cannot store paths to objects in tables, but it seems like i can considering the fact that when i tried printing the paths in output, it showed me the model.
Also please consider the fact that i don’t know tables very good
Here is the script :
local Tools = {
Axe = {"Log", "Fiber", ReplicatedStorage.ToolViewports.Axe.Model, ReplicatedStorage.ToolViewports.Axe:FindFirstChild("Camera")}
}
for _, button in pairs(recipes_frame:GetChildren()) do
if button:IsA("TextButton") then
button.MouseButton1Click:Connect(function()
if button.Name == "Axe" then
requirements_frame.Requirement1.Text = Tools.Axe[1]
requirements_frame.Requirement2.Text = Tools.Axe[2]
local ViewportModel = Tools.Axe[3]
local ViewportCamera = Tools.Axe[4]
print(ViewportModel)
print(ViewportCamera)
end
end)
end
end