Categories > Exploiting > Scripts >
Script I created doesn't work after I reset/die.
Posted
Hello, I am making an anomic script where it detects the player health if its under 50, but whenever I die, the script will never detect a health change. Here is the part where it detects the health:
localPlayer.Character.Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
print("Health change!")
if localPlayer.Character.Humanoid.Health < 50 and isToggled then
print("AutoMed..")
autoMed()
end
end)
How can I make it work even after I die with the script executed?
Replied
I have no idea, try to check Roblox Developer Forum: https://developer.roblox.com/en-us/
Cancel
Post
local info = {
[1] = "frel0#4458", [2] = "Scripter"
}
Replied
idk i dont script
Cancel
Post
I hide links and stuff in my post ✌ | they/them or he/him | stupid gay furry | ogredale#4684 | My epic site
♥💙💚💛💜🧡🤎💕
https://i.imgur.com/TVnRBe9.png
Replied
have I tried something like
if LocalPlayer.Character.humanoid.Health == 0 then
--code
else
--code
end
Well something on the lines of that
Cancel
Post
https://media.discordapp.net/attachments/1010636204225601659/1012865624797610044/sKQybOLT.gif
Replied
when Person respawn function
code
blah blah i don't do lua.
Cancel
Post
soy pro
Replied
its because when you die your character gets removed and becomes nil
this is a very messy solution but it works
game.Players.LocalPlayer.CharacterAdded:Connect(function(Character) -- Character is variable name, this runs every time plr spawns
Character:WaitForChild('Humanoid'):GetPropertyChangedSignal("Health"):Connect(function()
print("Health change!")
if Character.Humanoid.Health < 50 and isToggled then
print("AutoMed..")
autoMed()
end
end)
end)
Cancel
Post
I know LUA and some C#
Â
and i own synapse x noob
Replied
You gotta remember to make the functions for addMed() and stuff that you missed
LOL SO BAD LOLLLLLLLL
Cancel
Post
soy pro
Replied
I've tried your answers, but it doesn't seem to print any "Health change!" after I reset.
Cancel
Post
soy pro
Replied
while wait(1) do
if game.Players.LocalPlayer.Character then -- if character exists
if game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health < 50 then -- checks if health is less than 50
print("oh no player has less than 50 health")
autoMed() -- calls the function
end
end
end
This will contantly check if the players health is less than 50, if it is it calls the autoMed() function that you should already have in your script.
Cancel
Post
I know LUA and some C#
Â
and i own synapse x noob
Replied
its because the script detects the old character with the old humanoid
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post