I have been trying to make a cash register for a game and I want to store the name of the cashier into a StringValue.
Code: (LocalScript)
plr = game.Players.LocalPlayer
add = function() -- local add = function() doesn't work either
script.Parent.Parent.Parent.Parent.CustomerSide.Frame.LastAdded.Text = "Last added: " .. script.Parent.ItemName.Value
script.Parent.Parent.Parent.Cashier.Value = plr.Name
print(plr.Name)
end
script.Parent.ImageButton.MouseButton1Click:connect(add)
script.Parent.TextButton.MouseButton1Click:connect(add)
This code doesn't execute add() for some reason
EDIT: Using a regular Script instead of LocalScript does execute add() but it doesn't work with game.Players.LocalPlayer

2 comments
Still nothing
when I use this is a normal script it works except I can't use game.Players.LocalPlayer