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

Getting a random tween position help?

I'm trying to make it so it tweens to a random position every time, I think I'm putting the UDim2 values in the table wrong. pls halp!1!

local place = {UDim2.new(0.88, 0,0.926, 0), UDim2.new(0.88, 0,0.925, 0)}
function playshoottween()
	ammotext.TextColor3 = Color3.new(1,1,1)
	ammotext:TweenPosition(place[math.random(1,2)],"Out","Quad",1/30, false)
end

1 comment

0

you juet forgot to run your function playshoottween()

1 answer

local UDims={
	UDim2.new(0.88, 0,0.926, 0);
	UDim2.new(0.88, 0,0.925, 0);
}

function playshoottween()
    ammotext.TextColor3 = Color3.new(1,1,1)
    ammotext:TweenSize( -- I think you derped and used TweenPosition
 		UDims[math.random(1,#UDims)], 
	"Out","Quad", 0.3, true)
end

playshoottween()

2 comments

0

Actually his code was right he just forgot to run his function.

0

I know, but I just cleaned it up :)

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