How do i create constant poison damage?

the problem probably comes from here: Poisoned:GetPropertyChangedSignal(“Value”):Connect(function()
if Poisoned.Value == true then
repeat
if Poisoned.Value == true then
wait(10) – change how long you want poison to damage player for each time
Humanoid:TakeDamage(PoisonDmg)
else
break
end
until Poisoned.Value == false
elseif Poisoned.Value == false then
return
end
end)
probably in any line

that might be the problem, il try it

it isnt, i think its the value, i replaced it with 10, if i find any problems ill reply again

If it’s a value instance, then you need to do .Value after it to get the value.

i already did that, it did not work

local part = script.Parent

part.Touched:Connect(function(object)
if object:FindFirstAncestorWhichIsA(“Model”) and object:FindFirstAncestorWhichIsA(“Model”):FindFirstChildWhichIsA(“Humanoid”) then
print(“found!”)
local Model = object:FindFirstAncestorWhichIsA(“Model”)
local PoisonValue = Model:FindFirstChild(“Poisoned”)
local PoisonDmg = Model:FindFirstChild(“Poison Damage”)
if PoisonValue and PoisonDmg and Model then
PoisonValue.Value = true
PoisonDmg.Value = 10 – damage of the poison.
wait(10) – change to how long you want the poison to stay with the character
PoisonValue.Value = false
PoisonDmg.Value = 0
end
end
end)
there might ve something wrong with the script

do you have a possible alternate version of the constant poison damage?

I’m sorry if my scripts didn’t work for you, i will try out my script and fix it in Roblox Studio, i will update it to you as soon as i could

I found the issues from my script. I didn’t use Roblox Studio to troubleshooting earlier this day and i was too uncareful that causes both my time and your time wasted, i’m very sorry!

So this is the script that make player poisoned :

local part = script.Parent

part.Touched:Connect(function(object)
	if object:FindFirstAncestorWhichIsA("Model") and object:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid") then
		print("Found")
		local Model = object:FindFirstAncestorWhichIsA("Model")
		local PoisonValue = Model:FindFirstChild("Poisoned")
		local PoisonDmg = Model:FindFirstChild("Poison Damage")
		if PoisonValue and PoisonDmg and Model then
			PoisonValue.Value = true
			PoisonDmg.Value = 0.5 -- damage of the poison.
			wait(10) -- change to how long you want the poison to stay with the character
			PoisonValue.Value = false
			PoisonDmg.Value = 0
		end
	end
end)

The script inside player :

local Poisoned = script.Parent:WaitForChild("Poisoned") -- you can change the name if you want
local PoisonDmg = script.Parent:WaitForChild("Poison Damage") -- you can also change the name

local Humanoid = script.Parent:WaitForChild("Humanoid")


Poisoned:GetPropertyChangedSignal("Value"):Connect(function()
	if Poisoned.Value == true then
		repeat
			if Poisoned.Value == true then
				wait(0.1) -- customize how often you want your poison to damage
				Humanoid:TakeDamage(PoisonDmg.Value) -- i forgot .Value here
			else
				break
			end
		until Poisoned.Value == false
	elseif Poisoned.Value == false then
		return
	end
end)

I tested out the script in my own game already and it work pretty well. If you don’t have a same result, it’s probably because you misplacing something.

i have a problem, how can i make it so my own player, (aka the one in workspace) get damaged

What do you mean? like dummies or character in your game gets damaged by poison too?
In that case, it’s simple, just copy the script inside player, the boolValue, and intValue into a specific charcater/dummy you want in your own game

in game character not any custom character

Just do those above i told you but into StarterCharcaterScripts

no, it isnt a specific character, i meant like your avatar, you cant paste it in, because it resets

I don’t get it, can you explain it more specifically?
if you meant is something like pasting the poison related stuff into player?

(This topic is getting a little bit too long by the way)

like the player will take poison

not like anything else just the player

Is this what you want? Whenever player touched the poison part, they get poisoned and will get constant damage for a while and eventually they will get rid of it

yeah! can you tell me how? tahnks

yo u there? how do i do it, can u tell me how

1 Like