Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Getting a random tween position help?

Asked by
NotSoNorm 777 Moderation Voter
8 years ago

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
0
you juet forgot to run your function playshoottween() XToonLinkX123 580 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
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()

0
Actually his code was right he just forgot to run his function. XToonLinkX123 580 — 8y
0
I know, but I just cleaned it up :) MessorAdmin 598 — 8y
Ad

Answer this question