I keep getting this error I’m not sure why Money is a number value inside of workspace.cash here is the code
local clickDetector = workspace.Cash.ClickDetector
local cash = workspace.Cash
function onMouseClick()
cash.Money.Value = cash.Money.Value + 1
print(cash.Money.Value)
end
clickDetector.MouseClick:Connect(onMouseClick)
This is the error I’m getting “Money is not a valid memeber of Part"Workspace.Cash”"
local clickDetector = workspace.Cash.ClickDetector
local cash = workspace.Cash
function onMouseClick()
cash:WaitForChild("Money").Value = cash.Money.Value + 1
print(cash.Money.Value)
end
clickDetector.MouseClick:Connect(onMouseClick)
Could you send a screenshot of your studio so we can see the Explorer?
Press the Print Screen button on your keyboard, then copy and paste into the message thing here.
FYI using :WaitForChild() on the server is considered bad practice generally speaking, and should never be necessary except for a tiny minority of use cases.
local cash = script.Parent
local clickDetector = cash.ClickDetector
function onMouseClick()
cash.Money.Value += 1
print(cash.Money.Value)
end
clickDetector.MouseClick:Connect(onMouseClick)