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

How to make command seable to all players?

Asked by 6 years ago

So if I clone a Gui and move it to startergui, that Gui will only show to the certain player that requested it, like with MouseButton1Click. In my situation, how would I make it so ever would would see it? Would I have to switch from localscript to normal scripts?

Button.MouseButton1Click:connect(function()
    local Gui = script.Gui:Clone()
    Gui.Parent = game.ScreenGui
end
0
...wut? TheeDeathCaster 2368 — 6y
0
ask the question more SPECIFICALLY please. ILikeTofuuJoe 1 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Well, you MUST use a LocalScript. And PLEASE do not do :connect and it's :Connect

Anyways, here is the script remade. You're welcome.

local plr = game:GetService("Players").LocalPlayer

script.Parent.MouseButton1Click:Connect(function() -- assuming its a TextButton, and the Localscript inside it
    local clone = game:GetService("ReplicatedStorage").Gui:Clone() -- I put it in replicatedstorage because it's a good place for storage.
    clone.Parent = plr.PlayerGui -- You replicate Gui objects through a players playergui.
end)
0
what's wrong with using :connect Elixcore 1337 — 6y
0
They still do the same thing. There is nothing wrong using :connect(). It still functions correctly. MarceloFBentley 13 — 6y
0
:connect is deprecated KawaiiX_Jimin 54 — 6y
0
this is wrong, i see it gets placed into the only the plr's playergui, not the enitre server's jackalota 9 — 6y
Ad

Answer this question