Here's my local script which is located in Starter Player Scripts:
game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui'):SetTopbarTransparency(0)
You are using too many functions in one line. As a rule of a thumb, use only one function per line (however you may sometimes get away with two). To fix, split your code into few lines:
local Player = game:GetService('Players').LocalPlayer local PlayerGui = Player:WaitForChild('PlayerGui') PlayerGui:SetTopbarTransparency(0)
Now I am not 100% sure that changing Top Bar transparency is still supported, since the introduction of new transparent bar.
If you move the localscript into ReplicatedFirst use this script.
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") PlayerGui:SetTopbarTransparency(1)
I just tried it out and it does still work. While your script is correct, it is still better to divide it up. The only problem you had was it was in the wrong spot.