The problem I’m experiencing is “SetNetworkOwner()” and how its only working once, I don’t know if I messed up the code somewhere but any help is appreciated
Code:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Player,X,Y,Z)
if active == 1 then
active = 0
print("activated")
local h = game.ServerStorage.SuddenChanges.Bulleter:Clone()
local j = h.Aimer
h.Parent = game.Workspace
h.PrimaryPart = h.Hum
h:SetPrimaryPartCFrame(script.Parent.Parent["Torso"].CFrame * CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0))
script.Parent.Owner.Value = Player.Name
h.Aimer.Owner.Value = script.Parent.Owner.Value
j:SetNetworkOwner(Player)
wait(5)
active = 1
end
end)
script.Parent.Deactivated:Connect(function()
print("Deactivated")
end)```
Can you elaborate more. I Understood that you are having problems with SetNetworkOwner(). Also i understand that you are trying to do that so it doesn’t replicate and causes lag tho you should set it to nil. Why? It will set it to the server so there are no jitters in your bullet.
I heard that setting it to nil its bad cause lets say the game is packed; there will be a lot of fires shot and all that at the same time would cause lag/delay. Also, I can elaborate, when I did “h.Aimer:SetNetworkOwner(Player)” it only works once and then the tool becomes unusable.
Yes, technically, the bullet spawns on h so I parented the bullet to Aimer (The main part of h) so when I set the networkowner it would also smooth the bullets velocity.
I feel you are trying to fire it in this period as i believe your ‘active’ is a debounce which isn’t allowing the script to fire when it’s ‘0’.
Try reducing the wait to <1 (i may be wrong)