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

GUI Won't Clone Into A Players PlayerGui?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Azenix 1
10 years ago

There is a seat that works: http://www.roblox.com/Mark901s-AircraftSeat-item?id=36172684 ,although it is scripted you can try to edit it for your needs.

Ad

Answer this question