01 | local SetText = script.Parent.Text |
02 | local player = game.Players.LocalPlayer |
03 | local mouse = player:GetMouse() |
04 |
05 | function UpdateOldLabels(Parent) |
06 | for i,v in pairs (Parent:GetChildren()) do |
07 | if v.Name:sub( 1 , 4 ):lower() = = "line" then |
08 | local LineNumber = v.Name:sub( 5 ) |
09 | if LineNumber = = "12" then |
10 | v:Destroy() |
11 | else |
12 | v.Name = "line" .. tostring ( tonumber (LineNumber) + 1 ) |
13 | v.Position = v.Position - UDim 2. new( 0 , 0 , 0 , 15 ) |
14 | end |
15 | end |
You need to use a LocalScript, which runs locally.
"LocalPlayer" directs a LocalScript to the Player object that the LocalScript is using, but a server script(Simply called, a "script".) cannot use it.
I may be wrong, but I've checked the script exactly five times, and there seems to be no problem if it's a LocalScript, and you said, "this script", so I'm guessing it's a script.
A better answer may be found here: http://wiki.roblox.com/index.php?title=LocalScript