Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can some one help me with this boolean erorr for my fighting mob?

Hello I am sorry to bother you I keep getting this error

14:28:21.311 - Workspace.Red Devil Lvl1.Right Leg.Script:7: attempt to call a boolean value 14:28:21.313 - Stack Begin

14:28:21.611 - Workspace.Red Devil Lvl1.Right Leg.Script:7: attempt to call a boolean value

this is script

Damage = script.Parent.Parent.Damage.Value

function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local Friend = part.Parent:findFirstChild("Friend") if (h ~= nil) and (Friend == nil) and (script.Parent.Parent.Humanoid.Health > 0) or (script.Parent.Parent.Humanoid.Health > 0) (h ~= nil) and (Friend.Value ~= script.Parent.Parent.Friend.Value) then h.Health = h.Health - Damage end end

script.Parent.Touched:connect(onTouched)

1 comment

0

Look right underneath this comment, there will be an 'edit' button. Then all you do is highlight your code and click the blue Lua icon, then save. If you do it right it should put it in code format

1 answer

Can you turn the code into a code block so i can answer your question?

1 comment

0

Im not sure what a codeblock is as i am still learning but this is the line that gets the errorif (h ~= nil) and (Friend == nil) and (script.Parent.Parent.Humanoid.Health > 0) or (script.Parent.Parent.Humanoid.Health > 0) (h ~= nil) and (Friend.Value ~= script.Parent.Parent.Friend.Value) then h.Health = h.Health - Damage

This discussion is preserved as it was. New answers, comments, and votes are closed.