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

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

Asked by 2 years ago
01local ReplicatedStorage = game:GetService("ReplicatedStorage")
02 
03local cloneEvent = game.ReplicatedStorage.cloneEvent
04 
05local function cloneTool(Player,Tool)
06    script.Weapon.Value = Tool
07    local clone = game.Lighting:FindFirstChild(script.Weapon.Value):Clone()
08    clone.Parent = game.Players:FindFirstChild(Player).Backpack
09end
10 
11cloneEvent.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'

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? Fouxelefr 7 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

I think you need to get Lighting service

1local Lighting = game:GetService("Lighting")

This may fix the issue

Ad

Answer this question