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

Need help with fixing a gui giver which is only working on one player?

Asked by 4 years ago
Edited 4 years ago

In my last question I asked for help on making a gui which allows you to enter a players name and then give them a gui from replicated storage. The Script worked when I tested it with my username, Though when I went into a test game with another account and entered their username the script didn't give them the gui, it was the same when I tested it on a roblox studio 2 player test server. I need help on making it work on multiple players.

Original Post About The Script: https://scriptinghelpers.org/questions/91987/solved-trying-to-make-a-gui-to-give-a-player-a-gui-from-lighting-anyone-can-help

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Fixing it, saw the issue.

0
Will you upload the code of the script here, or on the previous post? kyloren528 11 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Ok, lets try it!

First Step : First of all you need to know how it works the Scripts and the LocalScripts in this case we will use a Script.

Second Step : Second, you need to know how to get the service and where you put the Gui and how we can get to the Gui

Third Step : Enjoy coding!

Lets get into the code!

--[[
    After read a comment I saw that is incorrect[My code] so lets fix it!
]]

local RS = game:GetService("ReplicatedStorage")
local Gui = RS:WaitForChild("ScreenGui")

local txtBox = Gui.Frame.TextBox --> Change it to your names
local player = game.Players:WaitForChild(txtBox.Text)
local playerGui = player:WaitForChild("PlayerGui")

local GuiClone = Gui:Clone()
GuiClone.Parent = playerGui

--> That's all! Thanks for notify me that was incorrect.

I hope my answer already solve your question. c:

0
That will not work, you cannot clone a gui directly into a player. You need to use PlayerGui. Also this is what we did in the last post, so there is no point in this, the code in that one is pretty much exactly the same as this proqrammed 285 — 4y

Answer this question