#collisiongroup not doing its thing
1 messages · Page 1 of 1 (latest)
local serverstorage = game:GetService("ServerStorage")
local physservice = game:GetService("PhysicsService")
local repstorage = game:GetService("ReplicatedStorage")
local baselosehpbindable = repstorage.baselosehpbindable
local mobmodule = {}
function mobmodule.move(mob, map)
local hum = mob:WaitForChild("Humanoid")
local waypoints = map.waypoints
for waypoint = 1, #waypoints:GetChildren() do
hum:MoveTo(waypoints[waypoint].Position)
hum.MoveToFinished:Wait()
if waypoint == 3 then
task.wait(1)
end
if waypoint == #waypoints:GetChildren() then
mob:Destroy()
baselosehpbindable:Fire(1)
end
end
end
function mobmodule.delete(mobname1, map)
local mob = workspace.mobs:FindFirstChild(mobname1)
if mob then
mob:Destroy()
end
end
function mobmodule.spawn(mobname, map)
local mob = serverstorage.mobs:FindFirstChild(mobname)
local spawnpoint = map:WaitForChild("spawn")
if mob then
local mobclone = mob:Clone()
mob.HumanoidRootPart.CFrame = game.Workspace.map.spawn.CFrame
mobclone.Parent = workspace.mobs
mobclone:WaitForChild("HumanoidRootPart"):SetNetworkOwner(nil)
for i, objects in ipairs(mobclone:GetDescendants()) do
if objects:IsA("BasePart") then
objects.CollisionGroup = "Mob"
end
end
coroutine.wrap(mobmodule.move)(mobclone, map)
local hum = mob:WaitForChild("Humanoid")
end
end
return mobmodule
this is a module script
Just look back on the gnomecode tutorial you used, you will find the rest of the code there.
gnomecode fixed this using setnetwork owner, but i did the same and this bug still here 💔
** You are now Level 6! **
I think part of the tutorial was deprecated.
yeah it really is
still i wanna find a solution to this