Hi, I am a new developer/scripter that is trying to get a script to work, the script being a script that controls effects (Burn, Freeze, Poison, Etc…)
to test the effect script out, I had a part to turn on the effect and the effect to execute an action if it is on. I just need some way for the part to turn on the effect. And a script for that player that could execute an action when that effect is on.
The mechanics for the part setting the effect are ok, But the script that is in charge for executing the effect action doesn’t work. And the part also has its own flaws, even the part that turns on the effect can only do it once, otherwise it dosen’t work.
effect script code:
local burnval = script:GetAttribute("Burn")
script:GetAttributeChangedSignal(function()
if burnval == true then
print("is burning")
end
end)
burn part code:
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent:FindFirstChild("EffectScript"):GetAttribute("Burn") == true then
print("already burned")
elseif hit.Parent:FindFirstChild("EffectScript"):GetAttribute("Burn") == false then
hit.Parent.EffectScript:SetAttribute("Burn",true)
print("set")
else
print("none")
end
end
end)
ill post more info once I find out how to.
I tried using bool values and attributes, but they don’t work.
im sorry if it is hard to read, this is also the first time im writing a help request like this.