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

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

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)

4 comments

0

Try adding a PlayerAdded function instead of just getting local player.. Then call 'plr' in the PlayerAdded function.

0

It's a local script*

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.

0

best advice i have ever got thx lol

1 answer

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

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