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

Excuse me, but.... Can anyone help?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Hi, erm, I have loads of scripting that needs to be done for a project I'm doing. What I seriously need done is, so, you have a partner in this project, and I want to make it so at the beginning you can choose between five partners. Like, function on click, and then that partner follows you and yadda. So, can anyone help? I seriously need this. qq

0
Btw, I only put physics because idk what this would be. qq Seaspirit89 0 — 10y
0
This isn't a request forum. PiggyJingles 358 — 10y
0
@Piggy I'm simply trying to learn a script, not commission one off. >_> Seaspirit89 0 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
local library = assert(LoadLibrary('RbxGui')) -- load our RbxGui library

function onItemSelected(item) -- create our callback that gets called when an item gets selected
    -- arguments:  item (string)
    print("'" .. item .. "' was selected!")
end

local listOfItems={"This", "is", "a", "list", "of", "items.","For","Your","Partners"} -- our list of items
local dropDownList, updateSelection=library.CreateDropDownMenu(listOfItems, onItemSelected); -- create the drop down list with our list and the callback
dropDownList.Size = UDim2.new(1, 0, 1, 0) -- this is to make the drop down list fit in our GUI correctly

local holderGui = Instance.new('ScreenGui') -- make the screen gui that holds everything
local holderFrame = Instance.new('Frame') -- make a frame to hold the drop down list
holderFrame.Size = UDim2.new(0, 200, 0, 26) -- make it the size you want
holderFrame.Position = UDim2.new(0.5, -100, 0.5, -20) -- position it the way you want (right now it's in the center)
holderFrame.BackgroundTransparency = 1 -- make it transparent for the drop down list
holderFrame.Parent = holderGui

dropDownList.Parent = holderFrame -- put the drop down list in the frame

if game.Players.LocalPlayer then -- make sure we have a player
    local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui"); -- wait for playergui
    holderGui.Parent = playerGui -- put the screen gui in the playergui
end

--GoodkidMad

Is this what your looking for?

0
Thank you! From what I can understand from scripting, this looks good! Seaspirit89 0 — 10y
0
No problem I'm glad I'm able to assist you! GoodkidMad 14 — 10y
Ad

Answer this question