I'm trying to setup a click event that sets up the GUI with the information it needs. It never gets past the FindFirstChild event and I don't undertsand why.
Cart = script.Parent.Settings.CartName.Value
script.Parent.Button.Click.MouseClick:connect(function(p)
local PlayerName = p
if game.Players:FindFirstChild(PlayerName) then
if game.Players.PlayerName.PlayerGui:FindFirstChild("Purchase") then
print("Nope")
else
Pur = game.Lighting.Purchase:Clone()
Pur.PurchaseScreen.PurchaseLabel.Text = "Purchase the "..Cart.."?"
Pur.PurchaseScreen.MinSpeed.Text = "Max Speed: "..game.Workspace.Settings.Carts.MinSpeed[Cart].Value..""
Pur.PurchaseScreen.MaxSpeed.Text = "Min Speed: "..game.Workspace.Settings.Carts.MaxSpeed[Cart].Value..""
Pur.PurchaseScreen.Cost.Text = "Price: "..game.Workspace.Settings.Carts.Prices[Cart].Value.."c"
Pur.CartName.Value = Cart
Pur.Parent = game.Players.PlayerName.PlayerGui
end
end
end)
