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

How to use the clone a value into a player when they join the game?

I am trying to make it so that when a player joins the game a value gets cloned into their playergui but I can't seem to do it. Could someone help? Thanks!

local clone = game.ServerStorage.canuseresearch:Clone()

game.Players.PlayerAdded:Connect(function(player)
	wait(1)
	print(player.Name .. " joined the game!")
	clone.Parent = game.Players[player.Name].PlayerGui.ScreenGui
end)

1 comment

0

Also you can just place a value inside ScreenGui and it will go into the playergui

1 answer

✓ Accepted answer

Place Inside workspace btw it takes 1.2 seconds for all scripts to load in, any time you are defining a new child which in this case is ScreenGUI. always add a wait for 1.2 seconds

local a=game.ServerStorage.canuseresearch:Clone()

game.Players.PlayerAdded:Connect(function(plr)

	wait(1.2)
	print(plr.Name .. " joined the game!")
	
	a.Parent = plr.PlayerGui.ScreenGui
end)

3 comments

0

also its easier to just define by finding who set off the function, instead of defining who set off the function then searching for it.

0

Thank you so much it worked and it is helping so much! Thank you!

0

Your welcome

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