I'd give a little more explanation but I'm a bit clueless on this one, my only idea is that maybe it lies in the two functions but I honestly have no clue. I'll explain a bit in detail what happens step by step
The other weird thing about this is that in F5 mode this works fine, the model doesn't disappear. It only disappears in a regular server. So maybe it's something to do with FE or Client to Server/vice versa
local player = game.Players.LocalPlayer local playerMouse = player:GetMouse() local debounce = true local tool = script.Parent tool.Equipped:connect(function() playerMouse.Button1Down:connect(function() local humanoid = player.Character:WaitForChild("Humanoid") if debounce == true then debounce = false if humanoid.Health < 100 then humanoid.Health = humanoid.Health + 25 wait(5) end debounce = true end end) end)
Edit I just tested it with the server test option so I could check out more whats going on and it seems the entire model, except for the handle is being deleted(or sent to some random place in the game)
I think this might be at the fault of my weld script, it was a free modeled one I took from the some open source gun models. I'm going to try and make my own and see if that fixes it; here is the current weld code
local function weld(x, y) local newWeld = Instance.new("Weld") newWeld.Part0 = x newWeld.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()* CJ local C1 = y.CFrame:inverse()* CJ newWeld.C0 = C0 newWeld.C1 = C1 newWeld.Parent = x end function weldParts(object) if object:IsA("BasePart") or object:IsA("UnionOperation") then weld(script.Parent.Handle, object) object.Anchored = false else for i, c in pairs(object:GetChildren()) do weldParts(c) end end end local function weldTool() weldParts(script.Parent) end script.Parent.Equipped:connect(weldTool) script.Parent.Unequipped:connect(weldTool) weldTool()