i don’t think loops are necessary since i know the name of it, i just have to know how to make it check its value 0 or not
wouldnt this work? plr.Resources.Wood.value >= 1
get the value of wood byitself and make it <= or >=
i did ~=, lemme try that rn brb
I may be wrong here, but doesn’t value need to be capitalized?
plr.Resources.Wood.Value
If you added something like a NumberValue into the workspace to hold this data, pretty sure the V needs to be capitalized or it won’t work.
i dont think it matters if its not or is
OH i forgot to check teh output, i accidently added a . before it
local change = game.ReplicatedStorage.Change
local woods = game.ReplicatedStorage.Wood
local wood = change.Wood
local woodp = change.Woodp
local rock = change.Rock
local rockp = change.Rockp
local metal = change.Metal
local metalp = change.Metalp
local glass = change.Glass
local craft = change.Table
wood.OnServerEvent:Connect(function(plr)
if not (plr.Character:FindFirstChild("Wood ["..plr.Resources.Wood.Value.."]") or plr.Backpack:FindFirstChild("Wood ["..plr.Resources.Wood.Value.."]") or plr.Backpack:FindFirstChild("Wood [0]") or plr.Character:FindFirstChild("Wood [0]")) then
local clone = woods:Clone()
clone.Parent = plr.Backpack
end
end)
if plr.Resources.Wood.Value == 0 then
-- Player has no wood
else
-- Player has at least 1 wood.
end
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Variables
local change = ReplicatedStorage:WaitForChild("Change")
local wood = change.Wood
local woodp = change.Woodp
local rock = change.Rock
local rockp = change.Rockp
local metal = change.Metal
local metalp = change.Metalp
local glass = change.Glass
local craft = change.Table
wood.OnServerEvent:Connect(function(plr)
if plr.Character:FindFirstChild("Wood ["..plr.Resources.Wood.value.."]") ~= true and plr.Backpack:FindFirstChild("Wood ["..plr.Resources.Wood.value.."]") ~= true and plr.Backpack:FindFirstChild("Wood [0]") ~= true and plr.Character:FindFirstChild("Wood [0]") ~= true then
local clone = ReplicatedStorage:WaitForChild("Wood"):Clone()
clone.Parent = plr.Backpack
end
end)