I wanted to remove the health script but when I did it, it was still in game
how can I delete that annoying script?
I wanted to remove the health script but when I did it, it was still in game
how can I delete that annoying script?
Maybe in StarterCharacterScripts just make an empty Script caled âHealthâ.
Were you deleting this on a local script? All you have to do is destroy it in a server script and itâs gone.
This is how you can achieve this in Roblox Studio (add empty âHealthâ script in StarterPlayer > StarterCharacterScripts):
You can also listen for CharacterAdded and disable âHealthâ Script, like this:
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Health").Disabled = true
end)
end)
nevermind removing as
somehow works that is typescript though not lua so donât be like me if you are coding ts files
You generally shouldnât be disabling scripts like this, just do what was mentioned above and make an empty Script called âHealthâ, this will overwrite the default one with the blank one.
For example this still runs
print("AAAA")
script.Disabled = true
while true do
print("BBBB")
wait(1)
end
I donât know how it works but it has to do with how coroutines work i guess
I donât think you can disable the script from the same script.
You can, you just canât rely on the behavior of disabling scripts.
It would be better if you ran a destroy function on the script, and thats all you would have to do.
By the way, Iâve a question. What app is it that youâre coding on?
Edit: If it was a wrong reply Iâm sorry.
VSCode with typescript and compiled through roblox-ts
That is not reliable at all, cause the other health script will still work. They just have to run a destroy function on it, although they have already solved this.
No, overriding the Script is better than destroying it.
If the methods in the posts above doesnât work, you should add this script into ServerScriptService:
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Wait()
player.Character:WaitForChild("Health"):Destroy()
end)
Put a script in called âHealthâ in StarterCharacterScripts, and that should fix your problem.
This is just a duplicate of my message, right here:
The only difference is that I disable the script and use CharacterAdded.
Sorry, I didnât see your message.
I also used CharacterAdded.