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

This is my script, why it can't clone a tool from lightning?

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local cloneEvent = game.ReplicatedStorage.cloneEvent

local function cloneTool(Player,Tool)
	script.Weapon.Value = Tool
	local clone = game.Lighting:FindFirstChild(script.Weapon.Value):Clone()
	clone.Parent = game.Players:FindFirstChild(Player).Backpack
end

cloneEvent.OnServerEvent:Connect(cloneTool)

This suppose to copy a weapon with a lauched name from lightning

but it give this error: Workspace.Cloner:7: attempt to index nil with 'Clone'

1 comment

0

Why do you want to clone a tool from lighting service? You coulld just use the replicated storage? And also, why are you using the value instead of defining the tool first?

1 answer

I think you need to get Lighting service

local Lighting = game:GetService("Lighting")

This may fix the issue

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