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

How can I clone something from Replicated Storage?

Asked by 10 years ago

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
Any errors? ultimate055 150 — 10y
3
Try capitalizing CFrame on :GetModelCframe() Tuneable 100 — 10y

1 answer

Log in to vote
-3
Answered by 10 years ago

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.

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 Tuneable 100 — 10y
0
Hey, im just giving a suggestion, but thios is much simpiler, more likely to work. rollercoaster57 65 — 10y
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. rollercoaster57 65 — 10y
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. adark 5487 — 10y
Ad

Answer this question