Still have questions? Join our Discord server and get real time help.
Log in to vote

Cloning from lighting and setting parent?

Asked by 6 years ago
clicked = 0
    player = script.Parent.Parent.Parent.Parent.Parent
    if clicked == 0 then
        if not player:FindFirstChild("Car") then
            car ="Model", Workspace)
            car.Parent = player
            car.Name = "Car"
        script.Parent.BorderSizePixel = 2
        script.Parent.BorderColor3 =, 0, 0)
        local addon = game.Lighting.cartestpart1:Clone() --change
        addon.Parent = player.Car
        addon.Position =, 5.79, 16.1)
        clicked = 1
    elseif clicked == 1 then
        script.Parent.BorderSizePixel = 0
        script.Parent.BorderColor3 =, 53, 53)
        clicked = 0

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
Answered by
Mr1Vgy 30
6 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:

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

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

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

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

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 1989 — 6y

Answer this question