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

Cloning sword help

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 comments

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

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.

1 answer

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

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