Just to give you a clip of what I mean, here's what I put down.
function OnClick() records.Visible = true records.Title = "History for "..player.Name.. end
Whenever I attempt to use that it errors with this: Expected identifier, got 'end' I did described what player was and all that was described but I can't get why it errors.
I did include additional things but only this part since it was the only part of the script that error'ed.
You have an extra ..
at the end of the line.
..
concatenates two strings -- one to the left and one to the right -- it "expected" another string to the right ('identifier'), but it got an "end" (on the next line)
Just
records.Title = "History for " .. player.Name
will show "History for BlueTaslem", for instance.
This is a good reason it's standard practice to put spaces around everything. You'll notice things like the trailing ..
much more easily.
local player = game.Players.LocalPlayer -- ADD THIS function OnClick() records.Visible = true records.Title = "History for "..player.Name.. end
First things first, you need to use the MouseButton1Click event which fires when you left click
on the gui. I did this on the last line.
On the first three lines, I made variables which you will need to make this work. Change the variables parenting and such to be correct.
Now in the function
I made the records gui visible and changed it's Text property to be the players name. Don't put two extra dots if you aren't going to Concate anymore.
You can read more on Concatenation here
local player = script.Parent.Parent local gui = script.Parent:WaitForChild("ScreenGui"):WaitForChild("Gui") local records = script.Parent:WaitForChild("ScreenGui"):FindFirstChild("records") function OnClick() records.Visible = true records.Text= "History for "..player.Name end gui.MouseButton1Click:connect(OnClick)