Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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)

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 Perci1 4988 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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

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 Jarick2543 0 — 7y
Ad

Answer this question