i have the same problem with this guy https://stackoverflow.com/questions/59436157/touched-function-roblox-studio please help me! ignore all wait,debounce,delay!
why no one can fix my problem about touch event :C?
2 answers
The way i solve this problem is to create a seperate non collideable box on top of the box you need the color changed.
and use .Touched and create a seperate function that checks if any player or anything still touching it with:GetTouchingPart()
vid : https://www.youtube.com/watch?v=TB-XrLsjfTo
debo = true
script.Parent.Touched:Connect(function()
if debo then
debo = false
workspace.Part.BrickColor = BrickColor.Red()
test = script.Parent:GetTouchingParts()
checkTouch()
end
end)
function checkTouch()
while #test > 0 do
wait()
test = script.Parent:GetTouchingParts()
end
debo = true
workspace.Part.BrickColor = BrickColor.Green()
end
This is just a rough idea on how to achieve this, you can try to modify this for better efficiency
Though i highly suggest not to use .Touched to achieve this and instead :
Try to use RayCasting instead, maybe find the part on ray from the client every time the player walk or a frame pass (RenderStep) and then change the color on the server (also create a way for it to not fire the server if the ray detect the same block over and over again), roblox's .Touched function is not very reliable on most cases
Edit : spelling and stuff
10 comments
subbed to your channel :>
THANK YOU SO MUCH!!!!!!!! your the one who solved my problem!
oopsie- did i was too late
ahhh i did too late so anyway lol
But wait, ImAnonymousBan, you said ' ignore all wait,debounce,delay!', but there some debouce tho, but anyways lol, I not kept saying anymore and, hope you good luck at your scripting travel!
lol im happy now because this problem kills me.
np happy to help, @Jack_Roblox2008 He probably meant the scrip ignore wait, debounce and delay and kept changing color despite having them
Also thanks for the sub, appreciate it :D
oo, im sorry for misturstanding you. but also good job XD, subbed.
yas, 200 points. i was a moderator voter now lol
Honestly, the script is working, but the script probably did wrong what they want to do.
First off, they kept shining, like a broken light bulb, that's not the thing that's he want to do, yeah, they accidentally do the wait(.5) inside the loop. So that's might be like that.
Yah, you can test it out this script:
local platform = script.Parent
local function changeColor(part)
part.BrickColor = BrickColor.new(‘Bright red’)
end
local function restoreColor(part)
part.BrickColor = BrickColor.new(‘Grey’)
end
local function TouchedPlatform(plr)
local h = plr.Parent:FindFirstChild("Humanoid") -- local the humanoid, and I literary bored and typed this lol
wait(.5) -- wait, the another helps scripting website had telled, they want to wait 0.5 seconds that touched, and after 0.5 second of touching the platform, they'll change the color. So, delete or no is your choice!
changeColor() -- fires the changeColor function.
if h then
wait(.5) -- more information below of this
changeColor() -- fires the changeColor function.
else
restoreColor()
end
end
-- Information:
-- The other help scripting website had told, they want to wait 0.5 seconds that touched, and after 0.5 seconds of touching the platform, they'll change the color. So, delete or don't delete is your choice!
I didn't check this on the ROBLOX studio, and it might get a lot of messy, so ill not saying much more, good luck! I have more time tomorrow, if their problems, comment below and describe how was the bug is. I can't use the ROBLOX studio because this is my mobile phone, and sorry for you. But, thanks for reading this! I hope you have A NICE DAY! C:
tha edits: spellings, grammar, and type this xD
Also, if this worked, please upvote! :D
2 comments
not working lol ;-;
xd sorry lol i using the ipad so I cant test out roblox studio so uhm, lol.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Post your script?
i want to fix the problem of this guy! https://stackoverflow.com/questions/59436157/touched-function-roblox-studio i have the same problem as him fix his problem to fix mine!
Make the part you actuly touch taller, invisible, and not collide so the player stands inside it instead of on it. (Or even better: use rays)