In my game reset character is disabled bc it is a story game
If you want I can add you in studio so you can see whatâs the problem if you want
No thanks i am not on my developement account right now.
You should try this because i believe it doesnât work because the character spawns before the CharacterAdded Function connects:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local function charAdded(Character)
if Character then
local ScriptCheck = Character:FindFirstChild("Health")
if ScriptCheck and ScriptCheck:IsA("Script") then
ScriptCheck:Destroy()
end
end
end
charAdded(player.Character)
player.CharacterAdded:Connect(charAdded)
end)
Then what I write in MainScript to disable Health script
Oh you want disable it from main script? Give me a moment
yes lol, mainscript is in sss btw
:((((((((((((((((((((( nooooooooooooooo
Iâm back i had to do something sorry
I canât understand what your trying to do, but to completely disable the health regen script, you can make an empty script in StarterCharacterScripts, which will stop roblox from inserting the health regen. Otherwise, if you want to enable it, maybe you can destroy() the roblox health regen script, then clone it back to the character to enable it.
I put script in startercharacterscripts then when game started I wait(10) HealthScript:Destroy() but it didnât work so yeahâŚ
If you want to re-enable, donât put an empty script in startercharacterscripts as that will completely disable it.
Maybe you can first destroy the playerâs script, then when you need it back, just clone it back (you will need a copy of the script somewhere)
If youâre trying to temporarily disable a script, use this line:
callYourScriptName.Disabled = true
Not too sure what youâre tryna do though since I read the people below your postâŚ
if you want to disable the heal just disable it from your main script and not a separate script?
for i, v in pairs(game.Players:GetChildren()) do
local Character = v.Character or v.ChildAdded:Wait()
Character:WaitForChild("Health"):Destroy()
end
Then I donât need health script in SSS?
Roblox injects the Health script into StarterCharacterScripts at runtime. Inserting similarly named scripts to services where Roblox injects scripts will override the engineâs copy with your own. The same goes for forking PlayerModule, components of the Lua Chat System and so on.
yeah you donât remove it from that you just remove the health script from the main script