0

# Can i localize a function?

Asked by 12 days ago

Can i localize a function? like this:

function SpawnShadow()
local Shadow = Instance.new("Part", workspace)



Can i do that?If not is there another way? because it does not know what shadow is when i create a

script.parent.MouseButton1Click:Connect(function()


0
TGazza 558
12 days ago

try this:

function SpawnShadow()
local Shadow = Instance.new("Part", workspace)
end -- need an end to your function!

-- not needed. this is only done this way if you're going to call your function from multiple places
--// SpawnShadow() -- call is good enough!