I need help disabling a Local Script in "StarterCharacterScripts"

  1. So I’m trying to make it that my “Local Script” in “StarterCharacterScripts” is disabled and reenabled in the script. Unfortunately it’s not working, so I need help.
local MaskEvent = rep:WaitForChild("StoneMaskFolder"):WaitForChild("MaskEvent")
local TweenService = game:GetService("TweenService")
local SCS = game:GetService("StarterPlayer"):WaitForChild("StarterCharacterScripts")
local BarrageEvent = rep:WaitForChild("StoneMaskFolder"):WaitForChild("Barrage")


local BarrageDamage = 5

MaskEvent.OnServerEvent:Connect(function(Player)
	local Character = Player.Character
	local Humanoid = Character.Humanoid or Character:WaitForChild("Humanoid")

	Humanoid.WalkSpeed = 0
	Humanoid.JumpPower = 0
	
	for i,v in pairs(Player.Character.Humanoid:GetPlayingAnimationTracks()) do
	print("played")
		v:Stop()
	end
		print("SCS = false")
	if SCS == true then
		SCS:Disabled()
	end
	
	local anim = Humanoid:LoadAnimation(script:WaitForChild("Activate"))
	anim:Play()
	Character.Humanoid.JumpPower = Character.Humanoid.JumpPower - Character.Humanoid.JumpPower
	
	local spiral = game.ReplicatedStorage.StoneMaskFolder.Spiral:Clone()
	spiral.CFrame = Character.HumanoidRootPart.CFrame
	
	wait(1.45)
	spiral.Parent = workspace
	game.Debris:AddItem(spiral,7)
	
	local info = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
	local goal = {}
	goal.Transparency = spiral.Transparency + (1 - spiral.Transparency)
	goal.Size = spiral.Size * 3
	local tween = TweenService:Create(spiral,info,goal)
	tween:Play()

	local Sphere = game.ReplicatedStorage.StoneMaskFolder.Sphere:Clone()
	Sphere.CFrame = Character.HumanoidRootPart.CFrame

	wait(1.45)
	Sphere.Parent = workspace
	game.Debris:AddItem(Sphere,3)

	local info = TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0)
	local goal = {}
	goal.Transparency = Sphere.Transparency + (1 - Sphere.Transparency)
	goal.Size = Sphere.Size * 3
	local tween = TweenService:Create(Sphere,info,goal)
	tween:Play()	
	
	Character.Humanoid.WalkSpeed = 0
	
	wait(.65)
	Character.Head.face.Texture = "rbxassetid://5819692652"
	
	wait(2)
	Character.Humanoid.WalkSpeed = 16
	print("no")
	
	
	local barragetool = rep:WaitForChild("BarrageKey"):Clone()
	barragetool.Parent = Player.Backpack
	
	local heavypunch = rep:WaitForChild("HeavyPunch"):Clone()
	heavypunch.Parent = Player.Backpack
	
end)```
	if SCS == true then
		SCS:Disabled()
	end

For what are you using this piece of code?

I tried making it so that if the local script in StarterCharacterScript was true it would be set to false so it would be disabled. Unfortunately it didn’t work.

Do you mean checking if this object exists?

EDIT: In your script SCP is just an object and if object == true then condition is always false. Objects properties can be true (an example: part.Anchored == true) and the object can’t be true. If you want to check if an obejct exists use if object then (suggested FindFirstChild()).

I tried that, but it didn’t work all I’m trying to do is disable/renable it. In my script so it doesn’t mess it up.

You could loop through starter character scripts and disable the script you want.

wait why are you activating it in StarterCharacterScript?

the script will be in the player’s humanoid? (just like PlayerGui/StarterGui that anyone can confuse with)

I think

	for i,v in pairs(Player.Character.Humanoid:GetPlayingAnimationTracks()) do
	print("played")
		v:Stop()

i see that this is a server script and that ur tryna disable a script on everyone so wat u should do is in the server event define the player that ur targeting then use disable the script in that players character