So, Im trying to make a basic game were currently you can claim a "Jeep" and It clones it into a folder and eventally any edits to your jeep are saved and copied into your own folder and the speed can be edited and ectra. My problem is the output log has just gone mental for me and I have no idea what its trying to do. I'll I know is that Ive tried Ive changed LocalPlayer to LocalPlayerT to see if thats the problem but. No.
local PlayVech = game.Players.LocalPlayer.Instance.new("Folder") PlayVech.Name = ("CarComp") PlayVech.Parent = game.Players.LocalPlayer print("MadeFolder") --- Created the folder called Carcomp which is were data of levels and info is placed. LocalPlayerT = game.Players.LocalPlayer LocalPlayerT.leaderstats.Level:Clone() LocLeaderStats = LocalPlayerT.leaderstats LocLeaderStats.Level.Parent = LocalPlayerT.CarComp print("CopiedLocalLevelStats") print("LoadingNextSteps..") --- Takes level LocalPlayerT.CarComp.Instance.new("Model") game.Workspace.JeepNoOwner:Clone() game.Workspace.JeepNoOwner.Parent = LocalPlayerT.CarComp.Model LocalPlayerT.CarComp.Model.Name = ("JeepOwned") --- Should Copy and paste a CLONE Of the jeep into a model in car comp.
No idea if it not working because Im Copying and pasting this into the player bit or its just because Im dumb and new. Tried debugging it but It came back messed up and I dont know what Ive done thanks for trying if you have.
P.s where is says LocalPlayer and CarComp There both inside the Player, wonder if thats messed it up.
PP.s When re reading this Instance.new didnt come up maybe thats it?
UPDATE:
So I've done what I think you've said and implemented it I hope this is right.
local PlayVech = Instance.new("Folder", game.Players.LocalPlayer) JeepCloneVar = LocalPlayerT.leaderstats.Level:Clone() --- Making the var for the clones. NewJeep = game.Workspace.JeepNoOwner:Clone() PlayVech.Name = ("CarComp") print("MadeFolder") --- Created the folder called Carcomp which is were data of levels and info is placed. LocalPlayerT = game.Players.LocalPlayer LocalPlayerT.leaderstats.Level:Clone() LocLeaderStats = game.Players.LocalPlayer.leaderstats LocLeaderStats.Level.Parent = LocalPlayerT.CarComp print("CopiedLocalLevelStats") print("LoadingNextSteps..") --- Takes level LocalPlayerT.CarComp.Instance.new("Model") game.Workspace.JeepNoOwner:Clone() NewJeep.Parent = LocalPlayerT.CarComp.Model LocalPlayerT.CarComp.Model.Name = ("JeepOwned") --- Should Copy and paste a CLONE Of the jeep into a model in car comp.
So this should work now? I hope so..
You can't do local PlayVech = game.Players.LocalPlayer.Instance.new("Folder")
instead do local PlayVech = Instance.new("Folder", game.Players.LocalPlayer)
and if you do that remove the PlayVech.Parent = game.Players.LocalPlayer
as the second argument in the Instance.new
sets the parent (although it is optional)
You also need to fix it for any other time you use Instance.New
Another thing is that when you are cloning store the cloned in a new local variable, so you have a reference to it, as when you clone Instances, they do not have a parent, and are not actually in the game
Creating a variable for the cloning you would do
local newvar = LocalPlayerT.leaderstats.Level:Clone()
replace newvar
with whatever you want to call your variable and that variable will be your reference to the new cloned instance
the same for the other one
local newjeep = game.Workspace.JeepNoOwner:Clone()
change newjeep
all you like just use that as a reference for the new one
instead of doing game.Workspace.JeepNoOwner.Parent = LocalPlayerT.CarComp.Model
to reference the new jeep just do newjeep.Parent = LocalPlayerT.CarComp.Model
What you're looking for is this:
local PlayVech = Instance.new("Folder", game.Players.LocalPlayer) JeepCloneVar = LocalPlayerT:WaitForChild("leaderstats"):WaitForChild("Level"):Clone() --- Making the var for the clones. local NewJeep = workspace:WaitForChild("JeepNoOwner"):Clone() -- Wait for it and then clone PlayVech.Name = "CarComp" print("MadeFolder") --- Created the folder called Carcomp which is were data of levels and info is placed. LocalPlayerT = game.Players.LocalPlayer LocalPlayerT.leaderstats.Level:Clone() -- Already waited for above (will error if destroyed) LocLeaderStats = game.Players.LocalPlayer.leaderstats LocLeaderStats.Level.Parent = LocalPlayerT.CarComp print("CopiedLocalLevelStats") print("LoadingNextSteps..") --- Takes level local CarCompM = Instance.new("Model", LocalPlayerT.CarComp) workspace:WaitForChild("JeepNoOwner"):Clone() NewJeep.Parent = CarCompM CarCompM.Name = "JeepOwned" --- Should Copy and paste a CLONE Of the jeep into a model in car comp.
Notes: You should use workspace (game.Workspace is big and why not use the variable?) To instantly parent a new object use Instance.new(class, parent) The above returns the new instance (like clone, but clone can't parent on its own) You can also do something like this to make an instance:
local part = Instance.new("Part") part.Position = Vector3.new(1, 3, 4) part.Anchored = true part.Parent = workspace
The above will create a part at the position 1, 3, 4 and anchor it... Its not instantly parented so it will only exist in the workspace after you assign those properties. Can be very useful sometimes.