I attempted to make it so when the player gets off the block it prints "not touching anymore" but it does not print
I decided to try this because the .TouchedEnded event is trash and doesnt work all the time ;(
script.Parent.Touched:connect(function(hit)
if hit.Parent:WaitForChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local coins = plr:WaitForChild("leaderstats"):WaitForChild("Coins")
local candy = plr:WaitForChild("leaderstats"):WaitForChild("Candy")
touching = true
CEopen:FireClient(plr)
while touching do
wait(1)
local touchingparts = script.Parent:GetTouchingParts()
for i,v in pairs(touchingparts) do
if v.Parent:WaitForChild("Humanoid") == nil then
print("not touching anymore")
end
end
end
end
end)

3 comments
Why don't you try to make a TouchedEnded event?
because its funky, when I use a touch ended event the touched event doesnt always fire, and when it does the touch ended event does not work its weird
IT IS CAUSE TOUCHING = TRUE THE ENTIRE TIME