Basically, I have a GUI that will allow a player to choose a name for their car shop. They click the submit button and it saves it. There are two scripts for this. The local script will take the player's name and the name they chose for their shop, and save it to two separate string values. This bypasses having to use server events. A secondary script, will take the values and apply them in DataStore and to a physical sign.
The issue is that the local script is not working. Like, at all. Not even the first line.
print ("Works") local player = game.Players.LocalPlayer local Button = script.Parent.Parent:WaitForChild("TextButton") Button.MouseButton1Click:connect(function(player) script.Parent.PlayerName.Value = player.Parent script.Parent.Value.Value = script.Parent.Parent.TextBox.Text end)
Nothing is being printed.
[EDIT] I changed the script to this and it still does nothing.
print ("Works") local player = game.Players.LocalPlayer function click() script.Parent.PlayerName.Value = player.Parent script.Parent.Value.Value = script.Parent.Parent.TextBox.Text end script.Parent.MouseButton1Click:connect(click)
If the first line isn't even printing, then I'm guessing the script itself isn't in the right place. A LocalScript
will only run if it's a descendant of PlayerGui
, Backpack
, PlayerScripts
, or the player's character.