Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Rainbow Over Head Gui not working?

Im not sure what I've done wrong can someone please help?

elseif name.Text == "Bxl0c" then
		name.TextStrokeTransparency = 0
		name.TextStrokeColor3 = Color3.new(0, 0, 0)
		role.TextStrokeTransparency = 0
		while wait(1) do
			role.TextStrokeColor3 = Color3.fromHSV(math.random(100)/100,1,1)
		function zigzag(x) return math.acos(math.cos(X*math.pi))/math.pi end
		
		counter = 0
		
		while wait(.1) do
			role.TextStrokeColor3 = Color3.fromHSV(zigzag(counter),1,1)
			
			counter = counter + 0.01
			
			end
		
		
		end
	
end
end)

2 comments

0

Is the TextStroke visible? [Pixels]

0

Yes it is, Its not that Im getting the problem on its "zigzag" ,"X*" and counter

1 answer

✓ Accepted answer

Introduce function before the loop:

function zigzag(x)
	return math.acos(math.cos(X*math.pi))/math.pi
end

Why introduce a loop within a loop?

name.TextStrokeTransparency = 0
name.TextStrokeColor3 = Color3.new(0, 0, 0)
role.TextStrokeTransparency = 0 
counter = 0
while wait(.1) do
	if counter % 0.1 == 0 then -- Assuming for every second you want to do a random colour (You can also use math.fmod() but I am not familiar with the Roblox lua's way)
		role.TextStrokeColor3 = Color3.fromHSV(math.random(100)/100,1,1)
	end
	counter = counter + 0.01
	role.TextStrokeColor3 = Color3.fromHSV(zigzag(counter),1,1) -- Use the function
end

This discussion is preserved as it was. New answers, comments, and votes are closed.