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

.......................Why is the code ignoring the "and"??

Asked by 5 years ago
Edited 5 years ago

needed to add dots to make the question longer.

when the sign touches it and the animation plays/the bool value is found then it should run. but it ignores the and why?

code:

local bottle = workspace.Bottle
local remote = game.ReplicatedStorage.RemoteEvents.Bottle_One
local plr = game.Players.LocalPlayer
bottle.Touched:Connect(function(hit)
    if hit.Parent.Parent:FindFirstChild("Sign") or hit.Parent.Parent:FindFirstChild("Hammer") and   plr.Backpack:FindFirstChild("Anim").Value == true then
        remote:FireServer()
        elseif plr.Backpack.Anim == nil then
    end
end)
0
Try adding a PlayerAdded function instead of just getting local player.. Then call 'plr' in the PlayerAdded function. B_rnz 171 — 5y
0
It's a local script* Freddan2006YT 88 — 5y
0
A script reads your code like a person would read a book, position is very important. Try putting the and statement before the or statement. Babyseal1015 56 — 5y
0
best advice i have ever got thx lol Freddan2006YT 88 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I was able to fix it myself, I didn't actually know what I did but it works!

Ad

Answer this question