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

Cloning from lighting and setting parent?

Asked by 10 years ago
01clicked = 0
02script.Parent.MouseButton1Click:connect(function()
03    player = script.Parent.Parent.Parent.Parent.Parent
04    if clicked == 0 then
05        if not player:FindFirstChild("Car") then
06            car = Instance.new("Model", Workspace)
07            car.Parent = player
08            car.Name = "Car"
09        end
10        script.Parent.BorderSizePixel = 2
11        script.Parent.BorderColor3 = Color3.new(255, 0, 0)
12        local addon = game.Lighting.cartestpart1:Clone() --change
13        addon.Parent = player.Car
14        addon.Position = Vector3.new(68.1, 5.79, 16.1)
15        clicked = 1
View all 21 lines...

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

3 answers

Log in to vote
0
Answered by
Mr1Vgy 30
10 years ago

Um I'm not sure why you're using the InsertService if you want to clone something from the lighting but what I usually do is:

1local car = game.Lighting.Car:Clone()
2car.Parent = game.Workspace
Ad
Log in to vote
5
Answered by 10 years ago
1a = game.Lighting["Epic Dino Man"]:Clone()
2a.Parent = game.Workspace.WHATEVER

Or if you just want to set its parent...

1game.Lighting["Epic Dino Man"]:Clone().Parent = game.Workspace.WHATEVER
1
Setting a = means you have to do more then change parent like.. If it is a script you may need to enable it fireboltofdeath 635 — 10y
Log in to vote
-5
Answered by 10 years ago

Please post the full output code, it shouldn't say just Stack End

0
Thats full output thats related to this script. I know what all the other errors in this game are and where they're coming from. YellowoTide 1992 — 10y

Answer this question