Hi, I was making this script where when you touched this part it would damage you for 5 seconds and it would change the text on the textlabel to say status: poison. But my script wont change the text. Can you help?
Textlabel script:
local plr = Game.Players.LocalPlayer
repeat wait() until plr
local status = Instance.new("StringValue",plr)
status.Name = "status-"..plr.UserId
repeat wait() until plr:WaitForChild("status")
while true do
wait()
script.Parent.Text = "Effects: "..plr.status.Value
end
Brick touched script:
local no = false
local plr = Game.Players.LocalPlayer
repeat wait() until plr
script.Parent.Touched:connect(function(part)
if not no then
no = true
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
plr.status.Value = "Poison"
for time = 5,0,-1 do
humanoid.Health = humanoid.Health - 5
wait(1)
end
wait(2)
no = false
end
end
end)
Can you try to help me with my script?

4 comments
This didn't work and there was no output. Do you know why?
Nope, this should work.
Local script right?
Yes, if it has LocalPlayer, it needs to be Local