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)```
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.
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 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