So in ServerScriptService I have a folder with scripts, and I have one script that disable health Regeneration,and it is disable right now, but in that folder I have MainScript and in that MainScript I want to when game start after like 10 seconds Health Regeneration script is enabled, so what is code for that,
Here is the script,btw it is normal script in SSS:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local ScriptCheck = Character:FindFirstChild("Health")
if ScriptCheck and ScriptCheck:IsA("Script") then
ScriptCheck:Destroy()
end
end)
end)
You’re removing the script instead of disabling/enabling it.
Try this:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local ScriptCheck = Character:FindFirstChild("Health")
if ScriptCheck and ScriptCheck:IsA("Script") then
ScriptCheck.Disabled = true --set to whatever boolean you need
end
end)
end)