function ProjectileReplication.ReplicateThrowable(y,w,s,X)if RunService:IsServer()then local H=y:GetSpawnedThrowable()local K=H:Clone()K:SetAttribute("\079\119\110\101\114\073\068",X.UserId)local c=K.PrimaryPart K:SetPrimaryPartCFrame(CFrame.new(w+s*2,w+s*3))K.Parent=workspace spawn(function()if c then c.VectorForce.Enabled=false end end)K.PrimaryPart:SetNetworkOwner(nil)DebrisService:AddItem(K,60)end end

function ProjectileReplication.ReplicateThrowable(weaponDefinition,position,direction,sendingPlayer)
	if RunService:IsServer() then
		
		local spawnedThrowableAsset = weaponDefinition:GetSpawnedThrowable()
		local clonedThrowable = spawnedThrowableAsset:Clone()
		
		-- Set the owner of this grenade for the combat api
		clonedThrowable:SetAttribute("OwnerID",sendingPlayer.UserId)
		
		local PrimaryPart = clonedThrowable.PrimaryPart
		
		-- Spawn the grenade infront of the player
		clonedThrowable:SetPrimaryPartCFrame( CFrame.new(position + direction * 2,position + direction * 3) )

		clonedThrowable.Parent = workspace
		
		-- Disable velocity force the next frame
		spawn(function()
			if PrimaryPart then
				PrimaryPart.VectorForce.Enabled = false
			end
		end)
	
		-- Server owns the grenade.
		-- Don't want exploiters to teleport the grenade at creation.
		-- Or make a "Grenade shield" hack.
		clonedThrowable.PrimaryPart:SetNetworkOwner(nil)
		
		-- The throwable should destroy itself, but just in case we'll clean up after some time
		DebrisService:AddItem(clonedThrowable,60)
	end	
end
