Let's image partTouching value is "Flashlight". Now look at line 15. The first variable of the list is also "Flashlight". So, when I'm comparing the two, for some reason, roblox decides that "Flaslight" and "Flashlight" are different things. Am I comparing the wrong thing? Help, please.
local detector = script.Parent
local itemList = require(game.ServerScriptService:WaitForChild("Modules").ShopItems)
local itemValue = script.Parent.Parent.Item
local debounce = false
detector.Touched:Connect(function(partTouching)
if debounce == false then
tostring(partTouching)
local debounce = true
for i = 1, #itemList do
print(partTouching)
print(itemList[i])
--print("something is touching")
if partTouching == itemList[i] then
if itemValue.Value == "" then
itemValue.Value = partTouching
end
end
end
detector.TouchEnded:Wait()
local debounce = false
itemValue.Value = ""
end
end)
