#why error line 15

1 messages · Page 1 of 1 (latest)

open sorrel
#

tuff

local SS = game:GetService("ServerStorage")
local Tool = SS.GiveDrops:FindFirstChild("DropCoal")

local Drop = script.Parent
local PickUp = Drop.ClickDetector

PickUp.MouseClick:Connect(function(player)
local NewTool = Tool:Clone()
NewTool.Parent = player.Backpack
NewTool.Name = "Coal"

Drop:Destroy()

end)

local Drop.Touched:Connect(function(player)
local NewTool = Tool:Clone()
NewTool.Parent = player.Backpack
NewTool.Name = "Coal"

Drop:Destroy()
toxic sierra
#

Drop is a tool or a part?

open sorrel
#

drop is a part and toolis the tool

toxic sierra
open sorrel
#

local was the problem thanaks

#

but why does local make it errored

toxic sierra
#

Bro you dont know how to script???

open sorrel
#

i am new bruh

grizzled crag
# open sorrel i am new bruh

"local" is used to create a variable in a local scope, when you put local and then another word like "local myVariable" the other word will be the new variable and you can assign it a value if you want like "local myVariable = 5", and so if you use local without putting a name of variable, it errors since a variable needs a name

final dust
final dust
#

you will learn along the way