how would i go about starting a script for script builder well this work?
plr=game.Players.LocalPlayer
plr = game.Players.LocalPlayer
would not work in a script builder. Most Script Builders use loadstring()
, a function now heading toward deprecation as it poses security risks to the games of which have game.ServerScriptService.LoadStringEnabled
enabled. Loadstring would convert a string to a function essentially and run the code like so. The bright side was you could inject code into your game any time you wanted provided you had some way to give the code to the game. You can learn more about loadstring here in our Glossary.
LoadString has its restrictions though. You have to have LoadStringEnabled set to true. With LoadStringEnabled set to true some features of your game become disabled such as Player Points as you do not want an exploiter to inject the code game:GetService("PointsService"):AwardPoints(1, 999999999999)
(Even though now Player Points don't take away from the owner or players of a game anymore, it's just a placement on the game's leaderboard). Another security feature with LoadString is it does not work in LocalScripts. As LocalScripts are for the client and are thus easier for exploiters to access, Roblox has straight up disabled LoadString for clients. Since LocalScripts are the only types of scripts to find LocalPlayer in Players service, the answer to your question would be no.
There have been scripts such as Epix Incorporated Server Suite which have replicated LoadString you could probably figure out how they work and make your own working version. However, script builders are somewhat a thing of the past and I would not recommend making a game LoadStringEnabled.
However if you're using it in a LocalScript and trying to communicate a string to the Server Script to produce a LoadString script to execute your code, using LocalPlayer would work. However if you meant this in the first place, you did not phrase your question well.