local Indicators = script.Parent
local BleedInd = Indicators.BleedingInd
local PoisonInd = Indicators.PoisonInd
local FreezeInd = Indicators.FreezeInd
local BurnInd = Indicators.BurnInd
-----------------------------------
local player = game.Players.LocalPlayer
local char = player.CharacterAdded:Wait() or player.Character
local effects = char:WaitForChild("Effects")
local effectValues = effects.Presets:GetChildren()
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
for i,v in pairs(effectValues) do
if v:IsA("BoolValue") and v.Value == true then
Indicators.Visible = true
if v.Value and v.Name == "Bleeding" then
BleedInd.Visible = true
end
if v.Value and v.Name == "Burning" then
BurnInd.Visible = true
end
if v.Value and v.Name == "Freeze" then
FreezeInd.Visible = true
end
if v.Value and v.Name == "Poison" then
PoisonInd.Visible = true
end
elseif v.Value == false then
Indicators.Visible = false
end
end
end)
I decided to create UI for when certain effects are triggered. This is probably extremely ineffective, but a start’s a start. Atleast it would be if it worked. When the values are triggered, the indicators do not appear at all. Why?
local Indicators = script.Parent
local BleedInd = Indicators.BleedingInd
local PoisonInd = Indicators.PoisonInd
local FreezeInd = Indicators.FreezeInd
local BurnInd = Indicators.BurnInd
-----------------------------------
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait() -- you switched these, which means the character might load before this script runs, and then it just won't run until the user dies.
local effects = char:WaitForChild("Effects")
local effectValues = effects.Presets:GetChildren()
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
for i,v in pairs(effectValues) do
if v:IsA("BoolValue") and v.Value == true then
Indicators.Visible = true
BleedInd.Visible = false
BurnInd.Visible = false
FreezeInd.Visible = false
PoisonInd.Visible = false
if v.Value and v.Name == "Bleeding" then
BleedInd.Visible = true
end
if v.Value and v.Name == "Burning" then
BurnInd.Visible = true
end
if v.Value and v.Name == "Freeze" then
FreezeInd.Visible = true
end
if v.Value and v.Name == "Poison" then
PoisonInd.Visible = true
end
break
elseif v.Value == false then
Indicators.Visible = false
end
end
end)