Categories > Exploiting > Scripts >

Script I created doesn't work after I reset/die.

SmittyTitty

JoeDaddy

Posts: 7

Threads: 4

Joined: Sep, 2020

Reputation: 0

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?

  • 0

xamel

Scripter

Posts: 128

Threads: 19

Joined: Sep, 2020

Reputation: 3

Replied

I have no idea, try to check Roblox Developer Forum:  https://developer.roblox.com/en-us/

  • 0

local info = {

[1] = "frel0#4458", [2] = "Scripter"

}

Posts: 586

Threads: 31

Joined: Jan, 2018

Reputation: 5

Replied

idk i dont script

  • 0

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

eb_

Formally known as Shade

vip

Posts: 1045

Threads: 4

Joined: Jun, 2020

Reputation: 44

Replied

have I tried something like

 

if LocalPlayer.Character.humanoid.Health == 0 then 

--code

else

--code

end

 

Well something on the lines of that 

  • 0

https://media.discordapp.net/attachments/1010636204225601659/1012865624797610044/sKQybOLT.gif

Posts: 258

Threads: 44

Joined: Oct, 2020

Reputation: 7

Replied

when Person respawn function

    code

 

blah blah i don't do lua.

  • 0

soy pro

trollhackerdude

LUA and C# programmer

Posts: 119

Threads: 33

Joined: Jun, 2018

Reputation: 1

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)

 

 

 

 

  • 0

I know LUA and some C#

 

and i own synapse x noob

Posts: 258

Threads: 44

Joined: Oct, 2020

Reputation: 7

Replied

@trollhackerdude

You gotta remember to make the functions for addMed() and stuff that you missed

LOL SO BAD LOLLLLLLLL

  • 0

soy pro

SmittyTitty

JoeDaddy

Posts: 7

Threads: 4

Joined: Sep, 2020

Reputation: 0

Replied

I've tried your answers, but it doesn't seem to print any "Health change!" after I reset.

  • 0

Posts: 258

Threads: 44

Joined: Oct, 2020

Reputation: 7

Replied

@SmittyTitty

 

I dunno.

  • 0

soy pro

trollhackerdude

LUA and C# programmer

Posts: 119

Threads: 33

Joined: Jun, 2018

Reputation: 1

Replied

@SmittyTitty

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.

  • 0

I know LUA and some C#

 

and i own synapse x noob

Posts: 3

Threads: 2

Joined: Nov, 2020

Reputation: 0

Replied

its because the script detects the old character with the old humanoid

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )