You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I am making a tower defense game.
Am currently working on tower placement but it doesn’t work…
this is the whole “Tower” module script that is put in the “Main” script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
function tower.Spawn(player ,name ,cframe)
local towerExists = ReplicatedStorage.Towers:FindFirstChild(name)
if towerExists then
task.wait(0.5)
local newTower = towerExists:Clone()
newTower.HumanoidRootPart.CFrame = cframe
newTower.Parent = workspace.Towers
newTower.HumanoidRootPart:SetNetworkOwner(nil)
for i, object in ipairs(newTower:GetDescendants()) do
if object:IsA("BasePart") then
object.CollisionGroup = "Tower"
end
end
else
warn("Requested tower dont exist", name)
end
end
spawnTowerEvent.OnServerEvent:Connect(tower.Spawn())
return tower
-
What is the issue?
It throws this error:
Argument 1 missing or nil (on line 12)
And this one:
Requested module experienced an error while loading -
What solutions have you tried so far?
Looking at Youtube and Developer forum but nothing…