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

Cloning sword help

Asked by 10 years ago

How do I make that when a round starts you recieve a sword cloned from lightning into your characters backpack and after the round ends the sword gets removed.

2
I find that you should at least put an effort. Try to make it even if you make an error it's OK we all do when we start scripting. ~Epicx4000 HexC3D 830 — 10y
0
Your question is not constructive. You are asking for a script. This script would have to be placed in a games whole backbone. The only even have possible answer without giving you a full script, would be use a Clone() method and a Remove() method. AmericanStripes 610 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
local Running = Workspace.Running --Place a BoolValue called Running in the workspace
local Sword = game.ServerStorage.Sword --Put your sword in ServerStorage
while wait(1) do
    if Running.Value == true then --Every second the script checks if there is a round going on
        for i, v in pairs(game.Players:GetPlayers()) do
            Sword:Clone(Backpack) --Gives the player a sword
            Sword:Clone(StarterGear) --Lets the player respawn with the sword
        end
    else --If there is NOT a round going
        for i, v in pairs(game.Players:GetPlayers()) do
            Sword1 = v.Backpack:FindFirstChild("Sword")
            Sword1b = v.Character:FindFirstChild("Sword") 
            Sword2 = v.StarterGear:FindFirstChild("Sword") --Finds the Swords
            if Sword1 then --Checks if the player has the sword
            Sword1:Destroy()
            Sword2:Destory()
            elseif Sword1b then --Checks if the player is holding the sword
            Sword1b:Destroy()
            Sword2:Destroy()
            end
        end
    end
end
Ad

Answer this question