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

How to fix this clickdetector not working from cloning a gui into a localplayer?

script.Parent.MouseClick:Connect(function()
	warn("Player Pressed Me")
	script.GUI:Clone().Parent = game.Players.LocalPlayer.PlayerGui
end)

2 comments

0

Is the script in a ClickDetector?

0

Nevermind

1 answer

✓ Accepted answer
script.Parent.MouseClick:Connect(function()
    warn("Player Pressed Me")
    local clone = script.GUI:Clone()
    clone.Parent = game.Players.LocalPlayer.PlayerGui
end)

You were trying to make the parent of the clone in the same function as cloning the GUI. That won't work.

1 comment

0

Sorry bit sleepy but thanks!

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