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

Local Script not working, And no errors in output?

Hi, I've made a Script to clone a Gui from Lighting into PlayerGui, But it won't do that. As usual the Roblox wiki is no help. Here's the script:

repeat wait() until game.Players.LocalPlayer 
local Player = game.Players.LocalPlayer
game.Players.PlayerAdded:connect(function()
	local Gui = game.Lighting.MovesGui1:Clone()
	Gui.Parent = Player.PlayerGui
end)

Cheers.

1 answer

The problem you're facing is that you're using a Local Script to perform a server-side task which it can't do. So use a regular script instead!

game.Players.PlayerAdded:connect(function(Player)
   local PlayerGui = Player:WaitForChild("PlayerGui")--This wait until the PlayerGui has loaded so it doesn't cause an error later on.
	if Player then
	game.Lighting.MovesGui1:Clone().Parent = PlayerGui
    end
end)

~ UserOnly16Charcters Hoped I helped you to answer your question! If you have any further question, don't hesitate to comment below!!

2 comments

0

Won't Work

0

@KenzaXI I tested the script and it seems to work perfectly fine on my end. So I don't know why it doesn't work for you.

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