#How would i make a part that deals damage consistently when a player is stood inside of it?
12 messages · Page 1 of 1 (latest)
@cunning valve u still here?
uuh
hello?
well here's the script
istouching = false
part = script.Parent
part.Touched:Connect(function(touched)
if touched.Parent:FindFirstChild("Humanoid") then
istouching = true
print("Touched!")
while istouching == true do
wait(.5)
touched.Parent.Humanoid:TakeDamage(5)
end
end
end)
part.TouchEnded:Connect(function(touched)
if touched.Parent:FindFirstChild("Humanoid") then
print("Not Touching!")
istouching = false
end
end)