Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

LocalPlayer is depreciated, what do I use now?

Asked by 6 years ago

Hi!

I'm new to all of this and was using youtube tutorials to build my game. I got up to a rough working draft and published it to ROBLOX. It didn't work, at all.

The problem I have come to discover is that ROBLOX's servers don't like the word "LocalPlayer" anymore.

What I am trying to do is create a GUI for the player but a lot of my code looks like this:

game.Players.LocalPlayer.Character.Humanoid.MaxHealth = (game.Players.LocalPlayer.leaderstats.Level.Value * 15) + 100

How should I rewrite this code?

Thanks in advance

1
A server does not know what a "LocalPlayer" is only a local script which runs on the clients device knows what a "LocalPlayer" is since the is only one player. User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by
nap516 87
6 years ago

Just like king said in the comments, is it a script or a local script? GUIs should be local scripts. So if it is a script change it to a local script and it should work.

Ad

Answer this question