I don't know how to use my players name in script?
Asked by
6 years ago Edited 6 years ago
Here is the code that I am using. What I need to do is add a part in the area that checks if the player already has the title "None" that changes the player's Stats or if they don't have the title removes stats. The Stats are located in game.ReplicatedStorage and the folder is within the players name, the issue is I cannot figure out how to make it work to find the player's name in the folder.
01 | local Button = script.Parent |
02 | local player = game.Players.LocalPlayer |
05 | if player.TitleFolder.Titles.Value ~ = "None" then |
07 | player.TitleFolder.Titles.Value = "None" |
08 | script.Parent.Parent.Parent.Title.Text = "Noob!" |
09 | local Title 1 = Instance.new( "BillboardGui" ,player) |
10 | Title 1. Name = "TitleGUI1" |
13 | elseif player.TitleFolder.Titles.Value = = "None" then |
14 | script.Parent.Parent.Parent.Title.Text = "Noob!" |
21 | Button.MouseButton 1 Click:connect(onClick) |
This is a LocalScript inside of a button, once clicked it changes the player's "Title" by checking for the "Title" value inside of the player. I am trying to make the Title give stats once equipped and removed if changed. Any help will be appreciated thanks