Hey guys. I am making a game about brewing Potions. But because of updates the scripts broke. How can I make the items interact. (When you hold an item (Ex: A key) and touch the item it interacts with (Ex: A door))
This is the Code I used to make interaction:
local function OnCardTouch0 (Hit) local Real = Hit:FindFirstChild("Item") local state = script.Parent.State.Value if Real and state == ("empty") then StateChange0()
= 0 end end
script.Parent.Touched:connect(OnCardTouch0)
Can Someone Help make it more efficient and un-breakable? It also has timed states. They work so it shouldn't be a problem! But if you can make timed states change in a more efficient way, I would love to know that as well! Thanks for your support guys!

1 comment
Yeah dude, you are going to need to indent and put the code in the correct lines. The script is confusing to read xd. But from what I am saying, you are trying to compare state(object value) to "empty" (string value).