Prevent function for overlarping and glitching texture

  1. What do you want to achieve? Keep it simple and clear!
    the issue is that whenever i use the function twice, it looks like the character (bf) (an fnf remake test) keeps glitching

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i find some but i didnt find any solution for it

local e12412241214 = false
function boyhit()
	local bf = getplr(nil,true)
	local stop = false
	if bf and bf.Name == "boy" then
		spawn(function()
			
			local tex = bf.boy.Decal
			while stop == false do
				spawn(function()
					wait()
					if e12412241214 == true then
						stop = true
						print("e")
					end
				end)
				e12412241214 = true
				tex.Texture = "rbxassetid://12916240112" 
				wait(0.04)
				
				tex.Texture = "rbxassetid://12916244302" 
				wait(0.04)
				tex.Texture = "rbxassetid://12916246085" --Insert decal's first texture 
				wait(0.04)
				tex.Texture = "rbxassetid://12916248236" --second texture
				wait(0.04) --wait 1 second, you can change this and make it different for every one
				tex.Texture = "rbxassetid://12916250726" 
				wait(0.04)
				tex.Texture = "rbxassetid://12916252443" 
				wait(0.04)
				tex.Texture = "rbxassetid://12916254291" 
				wait(0.04)
				tex.Texture = "rbxassetid://12916256336" --second texture
				wait(0.04) 
				tex.Texture = "rbxassetid://12916264855"
				wait(0.04)
				tex.Texture = "rbxassetid://12916267424"
				wait(0.04) 
				tex.Texture = "rbxassetid://12916269148"
				wait(0.04) 
				tex.Texture = "rbxassetid://12916272537"
				wait(0.04)
				tex.Texture = "rbxassetid://12916286489"
				wait(0.04)
				tex.Texture = "rbxassetid://12916288055"
				wait(0.1)
				e12412241214 = false
				break
			end
		end)
	end
end

heres the code for it, getplr is for the decal thingie

i guess the wait(0.04) probably is the issue (correct me if im wrong), maybe you should put the decal ids in a table and use For i, v loop instead of using wait all the time to update the frame

but how will i “stop” it (ik its using break) but
i actually need an way to dectect if theres something overlapping it

stop the for i, v loop you mean?

yeah but like how i wil dectect like making it stop = true and then a split sec stop = false and then continue the script?

this worked
thanks lol
i did this but im not really sure it actually works but i gtg sleep so it worked on a few songs (bc i will gotta sleep)
worked

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.