Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I clone something from Replicated Storage?

I put a model called Items in replicated Storage and I tried putting models to clone inside of it but I was having issues.

a = game:GetService("ReplicatedStorage").Items.Boat:Clone() 
a.Parent = game.Workspace
a:MoveTo(game.Players.LocalPlayer.Character:GetModelCframe().p)

(Sorry if this isn't the right tag)

2 comments

2

Any errors?

3

Try capitalizing CFrame on :GetModelCframe()

1 answer

Instead of using GetService, as technically, it is not a service. A service is anything that a programmer uses to do something ti the player, like sell something, move them from game to game. do this instead:

a = game.ReplicatedStorage.Items.Boat:Clone() 
a.Parent = game.Workspace
a:MoveTo(game.Players.LocalPlayer.Character.Torso.CFrame.p)--GetModelCFrame is not a method and it is easier to use CFrame then MoveTo, but hey, what works, works, right?

also, it would be better if it was in lighting, or ServerStorage. As long as the script is a local script on the players backpack/playergui, you should be fine.

4 comments

1

Actually ReplicatedStorage is a service and it's fine that he did GetService. Plus putting things in lighting isn't supported and if he used ServerStorage it wouldn't work because ServerStorage doesn't replicate to the client. And one more thing, GetModelCFrame() is a method

0

Hey, im just giving a suggestion, but thios is much simpiler, more likely to work.

0

Also, using game:GetService("service name") is not as good to use then game.ReplicatedStorage becuase you cant accsess the propeties or the properties of the childeran, or do many things.

0

That is simply not true, rollercoaster. Where did you get that info? Also, any of the Objects that are direct descendants of the DataModel (Game or game in scripts) are by definition Services. The Workspace is a Service, and so is Players. Some are not automatically in the DataModel when the server starts. If the name of the Service is changed, GetService will still get you the correct Service.

This discussion is preserved as it was. New answers, comments, and votes are closed.