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

Text doesn't show up and the Buttons/Labels are in the correct place?

Asked by 8 years ago

I click play, but the text doesn't show up, just the Frame. I tried changing the ZIndex, but it didn't do anything. Idk.

wait()
local player=game.Players.LocalPlayer
local sg=Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
----
local frame=Instance.new("Frame", sg)
frame.BackgroundColor3=Color3.new(60/255,60/255,60/255)
frame.Position=UDim2.new(0,5,0,150)
frame.Size=UDim2.new(0,175,0,200)
----
local box=Instance.new("TextBox", frame)
box.Transparency=1
box.Size=UDim2.new(1,0,0,50)
box.Text="ID"
box.TextColor3=Color3.new(215/255,215/255,215/255)
----
local button=Instance.new("TextButton", frame)
button.Transparency=1
button.Position=UDim2.new(0,0,.7,10)
button.Size=UDim2.new(1,0,0,50)
button.Text="Play"
button.TextColor3=Color3.new(215/255,215/255,215/255)
----
local text=Instance.new("TextLabel", frame)
text.Transparency=1
text.Position=UDim2.new(0,0,.5,-20)
text.Size=UDim2.new(1,0,0,50)
text.Text=""
text.TextColor3=Color3.new(0,170/255,255/255)
----
button.MouseButton1Down:connect(function()
    local sound=Instance.new("Sound", workspace)
    local mps=game:GetService("MarketplaceService")
    local asset=mps:GetProductInfo(box.Text)
    sound.SoundId="rbxassetid://"..box.Text
    text.Text="Playing "..asset.Name
    sound:Play()
end)

Answer this question