I need help with a script that is supposed to change touching to true while you are on a part and change it to false when you walk off, but it doesn't work, it sets it to true but not false. Can someone help?
local touching = false
local canchange = false
local changeable = true
script.Parent.Touched:Connect(function(touched)
touching = true
canchange = false
print(touching)
end)
script.Parent.TouchEnded:Connect(function(touched)
if changeable == true then
changeable = false
canchange = true
wait(1)
if canchange == true then
touching = false
end
changeable = true
end
print(touching)
end)

4 comments
You cannot print boolean values. Use a tostring().
Yes you can.
yea u can lol
well one time it gave me a error maybe it was for something else