my player is defind here since i couldnt figure out how to find local player in a normal script
game.Players.PlayerAdded:Connect(function(player)
local price = player.PlayerGui:WaitForChild("Gui").Main.Info.Price
local leaderstats = player:FindFirstChild("leaderstats")
local Cash = leaderstats:FindFirstChild("Cash")
if Cash.Value >= price.Value then
Cash.Value = Cash.Value - price.Value
The "price" is a intValue. When I did
local price = 100
it worked. But when i changed it back to
local price = player.PlayerGui:WaitForChild("Gui").Main.Info.Price
it didnt work. This is all in a normal script in workspace. Can someone explain why my script cant find the value of the "price" The "price" is located in the Gui

1 comment
Is the ouput saying something like cannot locate an object