My code isn’t working properly!
-
What do you want to achieve? I want a fish in my game to give a sort of “burning” effect, and when you are touched by the fish, you catch on fire!
-
What is the issue? It gives me the error “OnFire (the bool value) is not a valid member of [PLAYER]”.
-
What solutions have you tried so far? I’ve tried making changes to how it checks for the bool, but it still doesn’t detect it.
Heres the script inside of the fish:
script.Parent.Touched:Connect(function(hit)
local char = hit.Parent
if char then
hit.Parent.OnFire = true
end
end)
Heres the script inside of the player being set on fire:
while true do
local onFire = script.Parent.OnFire
if onFire.Value == true then
script.Parent.Humanoid.Health = script.Parent.Humanoid.Health - 5
end
wait(1)
end
Here is my explorer window:
Thank you if you can help me! If you need me to provide more info, please tell me!