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

When I clone a part from ReplicatedStorage it disappears after a second. How do i fix this?

Asked by 2 years ago
Edited 2 years ago

When a player presses a button on a GUI it fires a remote event and the server script picks it up and launches this code, But when it spawns into the workspace it disappears after a second.

local remote = game.ReplicatedStorage.SpawnCar

local function SpawnCar()
    game.ReplicatedStorage:WaitForChild("Car"):Clone().Parent = game.Workspace
end

remote.OnServerEvent:Connect(function(player)
    print("received")
    SpawnCar()
end)

I found out the when the parts of the car is grouped and I clone that it does not disappear but I need the parent to be a part so I can CFrame the car to the player when it spawns in

0
can the car fall into the void and destroy itself? try using :SetPrimaryPartCFrame to move the car into position from which it won't fall imKirda 4491 — 2y
0
that's not it because the car falls onto the baseplate and I can drive it for a second and then it deletes it self. Thanks for the suggestion though Darth_Vator1 0 — 2y
0
it can be because a dfiferent script is removing the car, check for :Destroy in other scripts imKirda 4491 — 2y
0
Is there a script inside the car which is destroying the car? AProgrammR 398 — 2y
View all comments (7 more)
0
I just checked I did not put a :Destory() into the car accidentally Darth_Vator1 0 — 2y
0
or anywhere else Darth_Vator1 0 — 2y
0
if you drop me .rbxl file of the place on discord i'll save your butt nob :) imKirda 4491 — 2y
0
i'm not doing that i have too much work in this game and i'm not going to trust you Darth_Vator1 0 — 2y
0
ok, try Ctrl + Shift + F in studio to search all and search for :Destroy or Debris:AddItem, both of these can remove your car imKirda 4491 — 2y
0
the is none that have to do with the car getting deleted Darth_Vator1 0 — 2y
0
Are you moving an invisible part whose child is a car model? Or it's a part of a car model? Anyways, try using Model:SetPrimaryPartCFrame(CFrame) MrSuperKrut 167 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Alright so i'm not sure what i did exactly but i remade my car and rewrote my car script and it works now? i have no idea why but thank you everyone for trying to help me fix this bug :)

Ad

Answer this question