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

this gui works, another doesnt?

Asked by
theCJarmy7 1293 Moderation Voter
8 years ago

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

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. TheDeadlyPanther 2460 — 8y
0
i just want to be able to see it without waiting for the game to load theCJarmy7 1293 — 8y

1 answer

Log in to vote
0
Answered by
Etheroit 178
8 years ago

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

Ad

Answer this question