I'm trying to make it so that when a value is greater or equal to a price (which is a value shown in line 12) it will print("green")
I get the error
20:53:58.844 - Argument 1 missing or nil 20:53:58.846 - Script 'Workspace.Tycoon.Tycoons.SampleTycoon.Buttons.Buy Drill - $50.Head.Script', Line 6 20:53:58.847 - Stack End
when i run it. Here's my script
repeat wait() until script.Parent.Parent.Parent.Parent:FindFirstChild("Owner") ~= nil
local name = script.Parent.Parent.Parent.Parent.Owner.Value
print("owner found")
repeat wait() until game.ServerStorage.MoneyStorage ~= nil
print("money found")
repeat wait() until game.ServerStorage.MoneyStorage:FindFirstChild(name) == true
while true do
wait()
if script.Parent.Parent.Parent.Parent.Owner.Value ~= "" then
local name = script.Parent.Parent.Parent.Parent.Owner.Value
local money = game.ServerStorage.MoneyStorage:FindFirstChild(name)
if game.ServerStorage.MoneyStorage(name).Value >= script.Parent.Parent.Price.Value then
print("green")
end
end
end
Thank you
Edit: Also if it helps, so basically i have this script which is in this model, there a value in the model and it changes its value according to who owns the model. I need it so that the script takes that name of the person and goes to the serverstorage and looks for his name, the model is in the workspace but the money storage which i'm trying to get to is in serverstorage. Ex: i own the model. game.ServerStorage.MoneyStorage.DanThDev but i need it to work for everyone, i tried to do something like game.ServerStorage.MoneyStorage:FindFirstChild(name) but i'm getting that error and yea. Hopes this helps answer this.
