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

How to put things into starterpack?

Asked by 8 years ago

Basically I want the players to have their swords put into Starterpack, how do I do that?

Player = game.Players.LocalPlayer

Sword = game.Lightning.Sword:clone()
Sword.Parent = Player.Backpack
0
Is this a local or server script? :) legosweat 334 — 8y

2 answers

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
8 years ago

Simply put the Sword into the Starterpack in Studio!

Alternatively, put the following into your command bar:

game.Lighting.Sword.Parent = game:GetService("StarterPack")

Note: On line 3 in your code, you misspelled "Lighting"

EDIT If you meant clone a tool into a player's backpack, you would use the following:

local ServerStorage = game:GetService("ServerStorage") --Use ServerStorage instead of lighting!
local Players = game:GetService("Players")
local Sword = ServerStorage.Sword

function giveTool(player, tool)
    --- Places a tool inside a player
    --@param Player player the player who will receive the tool (userdata)
    --@param Tool tool the tool the player will be receiving

    tool:Clone().Parent = player.Backpack
end

giveTool(Players.Narrev, Sword)
0
If you want the game to run on a Server you would have to use ReplicatedStorage. UniversalDreams 205 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

Actually, you don't need a script at all to insert a sword in the StarterPack. The most simple was to do this is that you can search for a sword in the toolbox, click the best sword, then from the Workspace, you can drag it into the StarterPack.

0
Yeah that's true, but I was making a shop gui :D! LightModed 81 — 8y
0
Oh well, AlvinBloxx has a tutorial about that visit his page oon youtube. supercoolboy8804 114 — 8y

Answer this question