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

How Do i Clone Into a local player's backpack? Its Not Working For Me.

script.Parent.MouseButton1Click:Connect(function()
	local closerange = game.ServerStorage.Loadouts.ShortRange["TEC-9"]:Clone()
	local closerange2 = game.ServerStorage.Loadouts.ShortRange["KSG 12"]:Clone()
	closerange.Parent = game.Players.LocalPlayer.Backpack
	closerange2.Parent = game.Players.LocalPlayer.Backpack
end)

There is my script how can i make it do what i want this script isn't working for me

script.Parent.MouseButton1Click:Connect(function()
	local closerange = game.ReplicatedStorage.Loadouts.ShortRange.TEC9:Clone()
	local closerange2 = game.ReplicatedStorage.Loadouts.ShortRange.KSG12:Clone()
	closerange.Parent = game.Players.LocalPlayer.Backpack
	closerange2.Parent = game.Players.LocalPlayer.Backpack
end)

This is a local script in my game and this doesn't even work it'll have the weapons there but the model wont show up and wont shoot

1 answer

Make sure "TEC-9" and "KSG12" are tool instances.

Edit: You can't get objects from ServerStorage/ServerScriptService on the client. If its not a local script and it turns out to be a server script, you cant check for MouseButton1Click on the server.

2 comments

0

i just checked and it is

0

look at my edit i changed it a little and it still doesnt work with your advice

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