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

Lerping code randomizing colors?

My lerping code is randomizing colors and I tried many resources to figure this problem out, I tried tweening, youtube videos, roblox dev fourm, a lua help server, and may things I tried to fix this but it's not working.

game.ReplicatedStorage.Events.FireDragonsIronFist.OnServerEvent:Connect(function(playermousePos)
	local chr = player.Character
	local RightH = chr["RightHand"]
	local RightUA= chr["RightUpperArm"]
	local RightLA = chr["RightLowerArm"]
	local OrangeColor = Color3.new(173, 87, 2)
	
	for i=10,10,10 do
 	wait()
 	RightH.Color = RightH.Color:lerp(OrangeColor,i)
	end
	
	for i=10,10,10 do
 	wait()
 	RightUA.Color = RightUA.Color:lerp(OrangeColor,i)
	end
	
	for i=10,10,10 do
 	wait()
 	RightLA.Color = RightLA.Color:lerp(OrangeColor,i)
	end
	
end)

1 comment

0

I would learn what for loops are and how they work before working with linear interpolation.

1 answer

I would recommend learning what while loops are. Here's two links for Alvin Bloxes Loop Commands for Beginner Scripters. Link1 Link2

1 comment

0

Thanks for reiterating(hehe) what I said earlier.

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