so im making a tower defense game, when i playtested
this happend:
how do i fix this?
Somewhere in your code, you’re trying to use SetNetworkOwner() on a part which is anchored. Can you show the script?
Also, wrong category, this should be under #help-and-feedback:scripting-support
script:
local ServerStorage = game:GetService(“ServerStorage”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local events = ReplicatedStorage:WaitForChild(“Events”)
local spawnTowerEvent = events:WaitForChild(“SpawnTower”)
local tower = {}
function tower.Spawn(player, name, cframe)
local towerExists = ReplicatedStorage.Towers:FindFirstChild(name)
if towerExists then
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 does not exist", name)
end
end
spawnTowerEvent.OnServerEvent:Connect(tower.Spawn)
return tower
i need the hat to get on the head when i place my npc
but now it just spawns on the place where i made the npc
Can I ask why you’re setting the network owner?
I think the best thing to do is just create the display model on the client to figure out where to place it, cause yeah.
Then when the player places it at said spot it checks if it can even be placed there instead
why does it work for him but not me? (typo?)(placed wrong in explorer?)
well for starters, it seems to be nothing with code, more of the model you are using that its accessories arent in the right place, which can be modified via the attachments in it If I recall correctly.
Also the tutorial could be out dated as I have no idea when it was created but it sure looks old.
What I’d recommend which isnt going to sound very nice but go try to learn some more basic concepts, and keep building them up and then this will be super easy. Like for instance you can learn about UI and make the UI for the game, learn about modules n stuff to make it more organized. Thats my recommendations
We can’t answer that for you because we don’t have access to the whole game to check for typos. You should be able to fix these issues yourself.
I’d go back to when they designed the tower, see if you missed anything regarding anchoring or accessories.
if u want i can show u all scripts in my game, also where the scripts are
i guess il go back with my own game and not a game from a tutorial, it was made 2 years ago