local display = dice.RI.numdisplay and dice.RII.numdisplay and dice.WI.numdisplay and dice.WII.numdisplay and dice.WIII.numdisplay and dice.WIV.numdisplay and dice.WV.numdisplay and dice.WVI.numdisplay
Whenever I roll my dice, only dice WVI displays its billboard gui, how do I make them all show their billboard gui?
full script if you want to know:
local ts = game:GetService("TweenService") local p1 = script.Parent.Parent.rollmove.RI local p2 = script.Parent.Parent.rollmove.RII local box = script.Parent.Parent.rollmove.Box local click = script.Parent.ClickDetector local dicee = script.Parent.Parent.rollmove.dice:GetChildren() local dice = script.Parent.Parent.rollmove.dice local dicenum = #dicee local display = dice.RI.numdisplay and dice.RII.numdisplay and dice.WI.numdisplay and dice.WII.numdisplay and dice.WIII.numdisplay and dice.WIV.numdisplay and dice.WV.numdisplay and dice.WVI.numdisplay for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true end local default_dist = script.Parent.ClickDetector.MaxActivationDistance script.Parent.ClickDetector.MouseClick:Connect(function(player) game.ReplicatedStorage.Roll:FireAllClients() script.Parent.ClickDetector.MaxActivationDistance = 0 script.Parent.SurfaceGui.Rolling.Visible = true script.Parent.SurfaceGui.Roll.Visible = false wait() local function moveItem(item, wp) local ti = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(2) end local function moveItems(item, wp) local ti = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local tween = ts:Create(item, ti, { Position = wp.Position}) tween:Play() wait(0.1) end for i = 1,dicenum do local diceget = dicee[i] moveItems(diceget, p1) end moveItem(box, p1) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 1 moveItems(diceget, p2) end moveItem(box, p2) box.Orientation = Vector3.new(0,180,180) for i = 1,dicenum do local diceget = dicee[i] diceget.Transparency = 0 diceget.Anchored = false end display.Enabled = true wait(6) for i = 1,dicenum do local diceget = dicee[i] diceget.Anchored = true diceget.Transparency = 1 moveItems(diceget, p1) display.Enabled = false end moveItem(box,p1) box.Orientation = Vector3.new(0,0,0) script.Parent.SurfaceGui.Rolling.Visible = false script.Parent.SurfaceGui.Roll.Visible = true script.Parent.ClickDetector.MaxActivationDistance = default_dist end)
Well hello again! You could use a for loop to go though each of the guis one by one.
Heres a code you could use!
for i,dicenum do local diceget = dicee[i] local display = diceget.numdisplay -- do whatever you need to get display on to the billboardgui. wait(3) end
you see you assigned multiple values to just 1 variable so it will randomly pick 1 value and just display it!
Hope this helped!
Any questions? Just ask!