Script disable problem

That made no sense.

Also, you should use the code block for your scripts (```), so it’s easier to see your script.

I don’t think the Health Script is loacted in StarterCharacterScripts since it’s added by roblox upon the insertion of the character

Or he may have added a custom health script himself before creating this topic

edit

He’s saying copy the Health script and put it in StarterCharacterScripts.

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:

elo

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

Add a modulescript named HealthRegenDisabler under MainScript


I gotta go sorry :sad:

:((((((((((((((((((((( 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.