So when I try to make it so that a part with a surface gui shows something from the players leaderstats/playerValues it doesnt work, there are no errors and its a local script can soemone help me?
This is the script:
local player = game.Players.LocalPlayer
script.Parent.Text = player.PlayerValues.LuckUpgrades.Value.."/"..player.PlayerValues.MaxLuckUpgrades.Value
player.PlayerValues.LuckUpgrades:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.Text = player.PlayerValues.LuckUpgrades.Value.."/"..player.PlayerValues.MaxLuckUpgrades.Value
end)
The point of local scripts it to make something happen only for a specific player. Just insert the local script in one of the instances mentioned by @MrKlocek2 and it will work. If this is a local script, every player might see something different on this surface GUI. If it was a server script, everyone would see the same thing.
Actually knowing your goal I’m pretty sure you could edit the UI of the player from the server by accessing it’s PlayerGui and changing the specific targeted GUI, for example;
This will change the ScreenGui for the player, however this still technically counts as a server change becausue you’re modifying it from the server, this only replicates it to the client - say you have two clients controlling one actual player (where you can atleast have two localscripts for each client and one playergui shared across them), this would appear across both clients’ screens.
FYI this change is live for everyone, but I don’t think it’ll deprecateLocalScripts - anyway the RunContext being set to Client does the same thing as a LocalScript, actually - unless there are major differences, LocalScripts can be inserted which is faster than inserting a Script and changing it’s RunContext. If you mean it bypasses Filtering Enabled or it can run in workspace, I can see why you think it would deprecate LocalScripts.