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

Choose Random Item from a Frame and Change Properties (LocalPlayer)?

Asked by
Moxeh 84
9 years ago

The goal of the script is to choose a random item from within the frame "Items". After selecting it will rename the object to "BuyItemSelected". After renaming it should change the transparency. The goal is to make it appear to flash and fade in and out. If there is a better way to do this or an easy solution please provide the complete edited or new script. Thanks so much! (Credit will be given in the "Credits" Gui on this game: http://www.roblox.com/--place?id=182401128)

while true do
    wait(1) --(10) will be used after testing
local modelGroup = game.Players.LocalPlayer.PlayerGui.StoreGui.Welcome:FindFirstChild("Items"):GetChildren()
local PickedModel = modelGroup[math.random(1, #modelGroup)]
local Model = PickedModel.BackgroundTransparency
Model.Name = "BuyItemSelected"
end
if game.Players.LocalPlayer.PlayerGui.StoreGui.Welcome.Items:FindFirstChild("BuyItemSelected") then
    local Chosen = game.Players.LocalPlayer.PlayerGui.StoreGui.Welcome.Items.BuyItemSelected
wait()
Chosen.BackgroundTransparency = 0 -- [0.5] is Default
wait(5) -- (.05) for smoother "Flashing"



end
0
Please put this in a code block, it makes our life a lot easier! Bman8765 270 — 9y
0
Just figured out how...sorry Moxeh 84 — 9y

Answer this question