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

GUI Won't Clone Into A Players PlayerGui?

I want to make it so when a Player sit's on a VehicleSeat, it clones a GUI to their PlayerGui. This Script is in the VehicleSeat:

a = script.Parent.Controls b = a:Clone() local LightSystem = script.Parent.Parent.Lights

function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player ~= nil then tool = b:Clone() local Lights = script.Lights:Clone() Lights.Parent = tool Lights.Value = LightSystem tool.Parent = player.PlayerGui end end end end

function onChildRemoved() if tool ~= nil then tool:Remove() end end

script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)

1 answer

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