I did realize however he needs to disable the default roblox health script which is the problem (title of the topic)
That is not completely true.
As @colbert2677 said, you can simply just use an attribute to toggle the health regeneration (something I should’ve thought of earlier).
Missed that part sorry
30chaa
Guys here I want to put script disable:
Here is the SSS folder:
Here is the HealthRegenerationDisable Script:
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)
Hope this helps…
Do you have any error in the output?
No I dont have any error in output
Does it work when you reset character?
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…