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

How do I make it so the player gets a sword when a match starts?

Asked by 10 years ago

I need the player to get a sword and a frontflip tool when a match starts in the game.

2 answers

Log in to vote
0
Answered by 10 years ago

Use this function (make sure you edit the Tools table!).

function GiveTools()
    local Tools = {} -- put the tools you want to give them here (index them like game.Lighting.Tool1)

    for i,v in next, game.Players:GetPlayers() -- loop through the players
        for i2,v2 in next, Tools do --loop through the tools
            v2:Clone().Parent = v.Backpack -- clone the tool into their backpack
        end
    end
end
Ad
Log in to vote
-3
Answered by 10 years ago
local tools = {"FirstTool", "Second tool"} -- Put the following tools in lighting

-- Put your Match starting script here below

wait(1) -- change to any number
game.Workspace.tools:Clone(game.Workspace.Players.StarterPack)

Untested so might not work. Hope it helped though

Answer this question