Okay, I am making a cash register and I am making it so when a player touches the invisible touch brick in front of the register it sets the value of the player.
The value sets the players name and I want to search the players for that player name.
How would I do that?
This is my script that doesn't work:
Button = script.Parent
playerName = script.Parent.Parent.Parent.Parent.NameValue.Value
local p = game.Players:FindFirstChild(playerName)
Price = script.Parent.Parent.Parent.Parent.Register.MoneyCharged
Button.MouseButton1Click:connect(function()
p.Money.Value = p.Money.Value - Price.Value
Price.Value = 0
end)
