Cloning from lighting and setting parent?
02 | script.Parent.MouseButton 1 Click:connect( function () |
03 | player = script.Parent.Parent.Parent.Parent.Parent |
05 | if not player:FindFirstChild( "Car" ) then |
06 | car = Instance.new( "Model" , Workspace) |
10 | script.Parent.BorderSizePixel = 2 |
11 | script.Parent.BorderColor 3 = Color 3. new( 255 , 0 , 0 ) |
12 | local addon = game.Lighting.cartestpart 1 :Clone() |
13 | addon.Parent = player.Car |
14 | addon.Position = Vector 3. new( 68.1 , 5.79 , 16.1 ) |
16 | elseif clicked = = 1 then |
17 | script.Parent.BorderSizePixel = 0 |
18 | script.Parent.BorderColor 3 = Color 3. new( 53 , 53 , 53 ) |
I'm trying to make a button that adds an object/model to a truck. I can't get it to work. And I'm stuck
OUTPUT: 'Players.Player1.PlayerGui.CarShop.BackGround.ClickTest.Scri', Line 12
17:48:23.445 - Stack End
17:48:23.447 - Disconnected event because of exception