Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

this gui works, another doesnt?

i have two guis to give me an item called good. one made entirely with scripts.it is:

local ScreenGui = Instance.new("ScreenGui", script.Parent);
local TextButton = Instance.new("TextButton", ScreenGui);
TextButton.Position = UDim2.new(0,1,0,1);
TextButton.Size = UDim2.new(0,150,0,100);
TextButton.BackgroundColor3 = Color3.new(255,255,255);
TextButton.Style = (3);
TextButton.Text = ("builder");
TextButton.MouseButton1Down:connect(function()
    local Good = game.Lighting.good:Clone();
    Good.Parent = game.Players.LocalPlayer.Backpack;
end)

the other is made with insert object. it is:

bin = game.StarterGui.plop.test

function Clicked()
    local Good = game.Lighting.good:Clone();
    Good.Parent = game.Players.LocalPlayer.Backpack;
end
bin.MouseButton1Down:connect(Clicked)

the first one works perfectly, but i cant see it unless i press the play button. i want toreplace it with the one i can see, but it doesnt work.

test = an image button plop = a screen gui they are both local scripts. help please

2 comments

0

Script 2 needs to be a localscript to work. Secondly, pressing play is the point. You are testing a game, you cannot have a script that works in studio, and the script will work in a game, but that's it.

0

i just want to be able to see it without waiting for the game to load

1 answer

✓ Accepted answer

I found error in your script. Change bin location to script.Parent.plop.test And change script parent to game.StarterGui

This discussion is preserved as it was. New answers, comments, and votes are closed.