You can make a system that when a bool value is false, the script you want to disable gets disabled. And when the value is true, the script gets enabled. Here’s a little script that will show an example
local enabled = script.BoolValue -- indexing the bool value
if enabled.Value == true then -- checking if the bool value is true
-- your code here
end
I may not have explained really clearly, and I am sorry for that.
First, a script cannot get “localplayer” since it read game:GetService(“Players”) global.
Second, game.Players.PlayerAdded should be in a script within’ “ServerScriptService”